Home > shapefile > How to re-project shapefiles?

How to re-project shapefiles?

December 12Hits:7
Advertisement

I wanted to re-project a QGIS project, but there is no such option. When searching for an answer I see ogr2ogr suggested for this task, by re-projecting each vector layer (shapefile in this example). However I don't get expected result:

C:\temp>ogrinfo -al -so misc.shp INFO: Open of `misc.shp'       using driver `ESRI Shapefile' successful.  Layer name: misc Geometry: Line String Feature Count: 10 Extent: (21.267388, 42.015857) - (21.270225, 42.017470) Layer SRS WKT: PROJCS["MGI_Balkans_zone_7_deprecated",     GEOGCS["GCS_MGI",         DATUM["Militar_Geographische_Institute",             SPHEROID["Bessel_1841",6377397.155,299.1528128]],         PRIMEM["Greenwich",0],         UNIT["Degree",0.017453292519943295]],     PROJECTION["Transverse_Mercator"],     PARAMETER["latitude_of_origin",0],     PARAMETER["central_meridian",21],     PARAMETER["scale_factor",0.9999],     PARAMETER["false_easting",7500000],     PARAMETER["false_northing",0],     UNIT["Meter",1]] id: Integer (10.0)  C:\temp>ogr2ogr -t_srs EPSG:4326 misc_re.shp misc.shp  C:\temp>ogrinfo -al -so misc_re.shp INFO: Open of `misc_re.shp'       using driver `ESRI Shapefile' successful.  Layer name: misc_re Geometry: Line String Feature Count: 10 Extent: (-34.004490, 0.000230) - (-34.004490, 0.000230) Layer SRS WKT: GEOGCS["GCS_WGS_1984",     DATUM["WGS_1984",         SPHEROID["WGS_84",6378137,298.257223563]],     PRIMEM["Greenwich",0],     UNIT["Degree",0.017453292519943295]] id: Integer (10.0) 

So new file has changed geographic coordinate system, but it's not projected.
How to do that?

Answers

Assuming you want to reproject a shapefile, one way within QGIS is to load the file, right-click on the layer, select Save As…, and then the following window appears:

How to re-project shapefiles?

If you click browse beside CRS you can choose a new projection to save your file in.

EDIT:

To reproject all shapfiles in the one folder, something like this could work:

set "str1=_projected"
for %f in (E:\data\*.shp) do ogr2ogr -t_srs EPSG:4326 %str1%"misc_re.shp %f

(I haven't tested this and am unfamiliar with string concatenation on windows, nor am I solving the ogr2ogr issue - but this code snippet loops through a folder and runs something on each file.)

Related Articles

  • Does Re-Projecting ShapeFile only update content of *.prj file?

    Does Re-Projecting ShapeFile only update content of *.prj file?October 6

    if i wish to change the projection of some shapefiles from .. lets say NAD83 (4269) to WGS84 (4326) ... and by using some 3rd party app .... does this mean the .prj file is only updated .. and not the content in the .shp file or any other associated

  • Projecting shapefile with transformation using OGR in pythonJanuary 27

    I want to change coordinate system of a shapefile from British National Grid to WGS84 (in order to be able to convert it to KML later on). To get the best results of projecting I would like to use OSGB_1936_To_WGS_1984_NGA_7PAR transformation (or lat

  • Is there a difference between projecting shapefiles then rasterizing & rasterizing shapefiles then projecting?October 2

    I currently have a project where I rasterize shapefiles into simple presence/absence (1 & 0) rasters and then add each one to a running total to create a total richness raster at the end. The shapefiles are in WGS84 projection, but I need the final r

  • How to Project shapefile from NAD 1983 UTM Zone 12 to WGS 1984 UTM Zone 13N?October 15

    I have a question and I have a shapefile that is in NAD UTM Zone 12 and Datum is North American Datum of 1983. What I would liket to reprojection it to NAD 1983 UTM Zone 13N and change the Datum to WGS 84 ? I have tried different methods but cane out

  • How to re-project shapefiles?

    How to re-project shapefiles?December 12

    I wanted to re-project a QGIS project, but there is no such option. When searching for an answer I see ogr2ogr suggested for this task, by re-projecting each vector layer (shapefile in this example). However I don't get expected result: C:\temp>ogrin

  • Fortifying re-projected shapefile for ggplot2 in ROctober 24

    I have a shapefile of US county boundaries which I got from the NHGIS. I can load the file using the rgdal package and see information about it: library(rgdal) shp_1860 <- readOGR("shp", "US_county_1860", stringsAsFactors = F) summa

  • Transforming and Projecting Shapefiles in R & ArcGIS for Desktop?

    Transforming and Projecting Shapefiles in R & ArcGIS for Desktop?September 20

    Perhaps this is an issue with one of my original data sources, but I've searched extensively to address this problem both through ArcGIS and R. I've got 2 separate sources of a county layer SourceA and SourceB. I'm trying to project the SourceA layer

  • How to re-project shapefile to be compatible with Openlayers satellite imageryFebruary 9

    The goal: Visualize a map using google's satellite (and projection) using my collected points. Right now I have a shapefile of my collected points from surveying. I created it by adding my csv file. The shapefile is working and has a projection of WG

  • Projecting shapefile with unknown CRS to WGS84 using QGIS?

    Projecting shapefile with unknown CRS to WGS84 using QGIS?June 18

    I've tried setting QGIS to on the fly, changing the layer settings, nothing. I'm at a lost cause. Although I am not a GIS professional. http://www.ecaidata.org/dataset/spanish-and-mexican-land-grants-in-california/resource/9c7a68d8-a73e-40bf-8b39-a1f

  • Incorrect fishnet after projecting shapefile to UTM

    Incorrect fishnet after projecting shapefile to UTMJanuary 6

    I have shapefile of my country (Nepal) whose geographic coordinate system is GCS_WGS_1984 and it's angular unit is degree. I have projected it to WGS_1984_UTM_zone_44N and it's new Linear unit is meter. I am in need of each fishnet grid of dimension

  • R using fortify to project shapefile on google map gives wrong resultsJanuary 6

    I have a shapefile that looks like this > str(FieldsMap) Formal class 'SpatialPolygonsDataFrame' [package "sp"] with 5 slots ..@ data :'data.frame': 3 obs. of 2 variables: .. ..$ id : int [1:3] 3 2 1 .. ..$ Attr: Factor w/ 3 levels "A&qu

  • Project only required shapefiles in folderApril 9

    I have 8 shapefiles in a folder with shapefile 1 and 8 in the same projection and the others (shapefile 2-7) if different projections. Is there a way to use python to use shapefile 1 as the projection template to project shapefiles 2-7 in a new folde

  • Projected raster data has inconsistent extent but not shapefileAugust 26

    I want to calculate the average value of a raster file within each polygon boundary of my shapefile. Because I want to preserve area I wish to use the Goode Homolosine (Land) projection. The original shapefile has a geographic coordinate system WGS19

  • Can Civil 3D reproject shapefiles? April 26

    Sorry to ask, but I just don't have time for help menus this week. That said, does anyone know if CAD is capable of re-projecting shapefiles? I find myself in a situation whereby I may have to use spatial data without access to ESRI software. The dat

  • Error importing Shapefile to PostGIS using Importer GUI

    Error importing Shapefile to PostGIS using Importer GUIJuly 6

    I'm trying to import a shapefile into a PostGIS database using the graphical importer. I just installed POSTGRESQL, and PostGIS. The GUI looks like this: After testing that my database worked, I chose the shapefile that I wanted to upload, and then r

  • What projection is this in GDAL classification

    What projection is this in GDAL classificationJuly 29

    I need to re-project a PNG from a given projection to the Google maps projection. I have a grid of the source projection, looks like a Mercator projection. What is the exact name of this projection in the GDAL classification? I need to re-project thi

  • Automate Projection of multiple shp files using ArcPySeptember 27

    I have been trying to create a Python script that will convert all shape files within a folder from GCS WGS 84 to Web Mercator. Below is the code I have so far but what I'm struggling with is how to iterate thru each of the files while creating a new

  • How to fix shape file projections

    How to fix shape file projectionsMay 1

    I have a project with several shape files. The files overlapping however. I have to go to unusable extents to even see the file on the same screen. I have tried using to project to as suggested here to now avail. Any ideas. I have created a public gi

  • Re-projecting point data using ArcMapMarch 19

    I've created a point data layer in QGIS using a .png image as a template. Of course the .png had no projection, and when creating the new shapefile I chose the WGS_84 coordinate system. Now, I need these data points to 'match up' with a (correctly pr

  • Shapefile list gone missing in dialog windowApril 15

    I have updated my script in ArcGIS 10.3 to include the copyFeatures_management geoprocessing tool because I want to only copy the features that already have the same projection, not reproject them; #Loop through shapfiles in folder and reproject for

Copyright (C) 2017 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 0.410 s.