Shape file reprojection

How can I reproject shapefile





Hello @davye, and welcome.

You just need to set up the two projections, and you can then use them to transform individual points, or entire Shapefiles, from one projection to the other.

To set up the projections, you can use the text as you’re showing, using ImportFromWKT

GeoProjection gp = new GeoProjection();
gp.ImportFromWKT(<your text string>);

Or you could use the predefined constants, but you should verify that they match your specific case:


Once you’ve set up the source and target projections, how you proceed depends somewhat upon your context. Look up ReprojectShapefile in the online documentation for the various options. My example here is using the Utils class

Shapefile sf = new Shapefile();
Utils utils = new Utils();
Shapefile reprojected = utils.ReprojectShapefile(sf, gpSource, gpTarget);

I hope this points you in the right direction.


I have done exactly that and get reprojection error.
I have tried using mapwindow5 toolbox “reprojectshapefile”
It also returns error
“GDAL FAILURE: No translation for “Lambert_Conformal_Conic” to PROJ.4 format is known.
GeoProjection: OGR: unsupported spatial reference.
GDAL FAILURE: No translation for “Lambert_Conformal_Conic” to PROJ.4 format is known.
Shapefile: Failed to start coordinate transformation.
No features were reprojected.”

Any other suggestions?

TO clarify and results of further testing
using ImportFromWKT returns the reprojection error noted previously

using gp.SetNad83Projection(tkNad83Projection.Nad83_Tennessee_ftUS) NO reprojection error is returned BUT doing a shape file saveas the .prj file is not Nad83_Tennessee_ftUS it is unchanged from the gpsource.

Further mapwindow5.4.1 does not have a Nad83_Tennessee_ftUS projection in the toolbox select coordinate system list only BLM and UTM are listed.

Help is appreciated

Hello @davye

Regarding the Lambert_Conformal_Conic, you may need to post your query to either the GDAL or PROJ4 sites. We simply call into GDAL to do transformations (an area I know little about), and they use the PROJ4 library (although I believe they may be up to PROJ6 now?). Perhaps someone on one of those sites could identify the problem.


Addendum: Out of curiosity, where did the textual projections come from? e.g. were they generated by a particular application/library?

Hello again.

Poking around, I see in the GDAL wkt support file, there exists EPSG 102736 (NAD_1983_StatePlane_Tennessee_FIPS_4100_Feet), which is associated with MapWinGIS enumeration tkNad83Projection.Nad83_Tennessee_ftUS.

This also exists EPSG 103152 (ESRI 6576) (NAD_1983_2011_StatePlane_Tennessee_FIPS_4100_Ft_US), which MapWinGIS does not have an enumeration for, and appears to be tagged as ‘deprecated’ in GDAL.

You could try entering the number into the API call ImportFromEPSG, and see if you can transform using that. But it may well be that GDAL no longer transforms since it is deprecated.

GeoProjection gp = new GeoProjection();
// or you could try 6576, but I think that's the ESRI code and not the EPSG code

Again, I’m not well versed on geoprojections, I just use them ;-). And maybe I’m not reading / interpreting the file correctly. See what you think. Here is the section from the GDAL file esri_extra.wkt that is distributed with GDAL. I don’t know whether it is saying that 6576 is deprecated, or if 6576 is the replacement for 103152, which is deprecated. Either way, if there are problems loading the projection using one or both of the codes, I would submit a query on the GDAL sight to get more information.

# NAD_1983_2011_StatePlane_Tennessee_FIPS_4100_Ft_US [NAD 1983 2011 SPCS Tennessee (US Feet)]
# area: (lat: 34.98, 36.68) - (lon: -90.31, -81.65) [USA - Tennessee]
# DEPRECATED: new code = 6576