Does MapSuite’s coordinate conversion system support Canada’s ntv2 NAD27 -> NAD83 datum shift. nrcan.gc.ca/earth-scien…tions/9074
I know Proj4 can do it with a bit of mucking around trac.osgeo.org/proj/wiki/NonFreeGrids but wondering whether this is built into MapSuite’s implementation?
Mike
Datum shift support in MapSuite
Hi Michael,
Sorry to say the Map Suite doesn’t support such function currently, but seems like it is a good feature which is worth for us to do more investigations on it. Now, I have posted it as a new feature on our Gemini issue system and our development team will take into considerations once we have enough resources. But I am afraid it is hard to implement in a short time.
Thanks for your suggestion.
Regards,
Johnny
Thanks for the response Johnny.
Is there any way of doing a ntv2.0 datum shift with MapSuite? This is a pretty important feature for our geographic area.
Hi Michael,
Sorry we haven’t found other workaround for now.
Our developer will integrate this new feature and include that in daily build package after test.
Regards,
Don
Thanks Don. Do you have a link to this feature request for this work so I can monitor it’s progress?
Thanks
Hi Michael,
Sorry the task is listed in our inner issue system and we don’t have an open link for monitor it.
I will ask our developer to raise priority of this task and update it in post if it’s complete.
Regards,
Don
Hi Don,
Do you have any time line on possible implementation? We need to know whether it will be done before April or not. If it’s not we may have to do a temporary implementation ourselves.
Hi Micheal,
Sorry for the mistake we have made in our previous reply, we double checked actually NAD27(corresponding epsg is 4267) could be converted to NAD83(corresponding epsg is 4269) with following code:
BaseShape yourShape = …;
UnmanagedProj4Projection projection = new UnmanagedProj4Projection();
projection.InternalProjectionParametersString = UnmanagedProj4Projection.GetEpsgParametersString(4267);
projection.ExternalProjectionParametersString = UnmanagedProj4Projection.GetEpsgParametersString(4269);
projection.Open();
BaseShape ConvertedShape = (PointShape)projection.ConvertToExternalProjection(yourShape);
if you have any more question , please feel free to let us know.
Sorry Again
Summer
Hi Summer,
I don’t think that code will do a ntv2.0 conversion though. At least that’s not the default behaviour of proj4 if that’s what is used behind the scenes. Please confim.
Mike
Hi Micheal,
Thanks for your reminding, but I used NTv2 online version to test and I got following result
And I used the code in previous reply to test and I got following result:
As you could see, the result are almost the same, so, would you please give it a double check?
please correct if I am wrong.
Thanks,
Summer
Those numbers actually aren’t that close.
en.wikipedia.org/wiki/Decimal_degrees#Accuracy
3 decimal places error adds up to over 100 meters - see my above link. When we test this we expect the results to be within 6 decimal places.
I think the key is whether the +nadgrids parameter is set in the proj.4 call.
I’m wondering whether I can just add +nadgrids=@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat to ExternalProjectionParameterString and then copy the grid files into the same folder as the ThinkGeo binaries? Would that work?
Hi Micheal,
Thanks for your further information, and you’re right that our code would not work because we don’t support NTv2, once I thought the conversion was from epsg4267(spatialreference.org/ref/epsg/4269/) to epsg4269(spatialreference.org/ref/epsg/4269/).
Now, if your could have NTv2 NAD27 and NAD83 proj4 string or esri string or epsg string, then your could try following code:
BaseShape yourShape = new PointShape(-128, 50);
ManagedProj4Projection projection = new ManagedProj4Projection();
projection.InternalProjectionParametersString = NTv2NAD27String;
projection.ExternalProjectionParametersString = NTv2NAD83String;
projection.Open();
BaseShape ConvertedShape = (PointShape)projection.ConvertToExternalProjection(yourShape);
Sorry for the inconvenience we made for you.
Best Regards
Summer
I’ve had a developer test this, and it seems even if we add that +nadgrids to the ProjectionParametersString it doesn’t seem to use the grid files to convert the datum.
Is there anyway to do this or should I put in a support ticket?
Hi Micheal,
If it’s hurry I think you should want to create a temporary class for reprojection your shapes. Because our currently logic cannot parse the string like: “+proj=latlong +ellps=clrk66 +nadgrids=@ntv2_0.gsb +to +proj=latlong +ellps=GRS80 +datum=NAD83”, it will throw exception.
Regards,
Don
Since your logic cannot parse the string, is there an easy way I can access the proj.4 code directly?
Hi Michael,
The problem is not only cannot parse the string, but also because in our current classes it don’t have a position to save and use this part after @ntv2_0. Too many parts are related with this change so we haven’t found a workaround for it.
If we want to directly access proj4’s APIs, I think find some of their samples should be helpful.
Regards,
Don
If you look at this ThinkGeo example wiki.thinkgeo.com/wiki/Source_Code_DesktopEditionSample_SphericalMercatorProjectionAdjustment_CS_110514.zip
You can see that in this example it’s turning off datum conversions using the +nadgrids option. So obviously it can parse the +nadgrids option but if we add the @ntv2_0.gsb portion it can’t seem to find the grid file.
Hi Michael,
I think we set +nadgrids=@null is because related code is not ready.
In fact for @ntv2_0, we get exception when parse is because the sample string “+proj=latlong +ellps=clrk66 +nadgrids=@ntv2_0.gsb +to +proj=latlong +ellps=GRS80 +datum=NAD83” contains two “+proj” nodes.
We don’t have related code for parse @ntv2_0 format, so your grid file cannot be used.
Regards,
Don
I’m not sure why you are using that sample string and have two +proj nodes. Why not do the same as the example and just set the +nadgrids= parameter on the External Projection?