Shape file reprojection

How can I reproject shapefile

FROM

GEOGCS[“GCS_North_American_1983”,DATUM[“D_North_American_1983”,SPHEROID[“GRS_1980”,6378137,298.257222101]],PRIMEM[“Greenwich”,0],UNIT[“Degree”,0.017453292519943295]]

TO

PROJCS[“NAD_1983_2011_StatePlane_Tennessee_FIPS_4100_Ft_US”,GEOGCS[“GCS_NAD_1983_2011”,DATUM[“D_NAD_1983_2011”,SPHEROID[“GRS_1980”,6378137.0,298.257222101]],PRIMEM[“Greenwich”,0.0],UNIT[“Degree”,0.0174532925199433]],PROJECTION[“Lambert_Conformal_Conic”],PARAMETER[“False_Easting”,1968500.0],PARAMETER[“False_Northing”,0.0],PARAMETER[“Central_Meridian”,-86.0],PARAMETER[“Standard_Parallel_1”,35.25],PARAMETER[“Standard_Parallel_2”,36.41666666666666],PARAMETER[“Latitude_Of_Origin”,34.33333333333334],UNIT[“Foot_US”,0.3048006096012192],AUTHORITY[“EPSG”,6576]]

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:

gp.SetNad83Projection(tkNad83Projection.Nad83_Tennessee_ftUS)

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();
sf.Open(<pathToShapefile>);
Utils utils = new Utils();
Shapefile reprojected = utils.ReprojectShapefile(sf, gpSource, gpTarget);

I hope this points you in the right direction.

Regards,
Jerry.

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?
thanks

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
thanks

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.

Regards,
Jerry.

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
gp.ImportFromEPSG(103152);

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
103152,PROJCS["NAD_1983_2011_StatePlane_Tennessee_FIPS_4100_Ft_US",GEOGCS["GCS_NAD_1983_2011",DATUM["D_NAD_1983_2011",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",1968500.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-86.0],PARAMETER["Standard_Parallel_1",35.25],PARAMETER["Standard_Parallel_2",36.41666666666666],PARAMETER["Latitude_Of_Origin",34.33333333333334],UNIT["Foot_US",0.3048006096012192],AUTHORITY["Esri",6576]]