We have an application which uses DesktopEdition to render shapes over the WorldMapKitData shapefiles Recently, I began to add support for GoogleMaps with the GoogleMapsOverlay. I have nearly everything working using a Projection to/from WGS84 to GoogleMaps which changes all the points on the map from DecimalDegrees to Meters. However, the EllipseShape does not seem to render correctly when it comes to the radius of the ellipse. I have only been using DistanceUnit.Kilometer for both the WorldMapKit and the GoogleMaps but the distance from the center seems to vary widely. Below is a image of the WorldMapKit and GoogleMaps showning several EllipseShape render over the maps. Note that the polygon in both image appears to cover the same area on both maps but the orange circle on the WorldMapKit is entirely outside the polygon while it is partially inside the polygon on GoogleMaps. Note also how the range rings become more an more different the larger the radius. The range rings are supposed to be drawn every 50 kilometers from 50 to 250. Note how the 250 kilometer ring is well north of Philadelphia on the WorldMapKit but is shown right about the Philadelphia area on GoogleMaps.
I found another topic on the discussion forum about this issue and it was discussing the difference in the projection for DecimalDegrees and Meters. I can understand how the Ellipse is a true circle for GoogleMaps while it is an oval for the WorldMapKit due to the difference in a Mercator versus an Spherical projection but my difference in distance appears to be greater then the circle/oval distortion.
Can anyone tell me why the EllipseShape radius seems to be so drastically different in GoogleMaps?. I am not doing anything to the radius to adjust for the projection different. Can anyone tell me how to adjust the radius - it seems that both should be in kilometers or whatever distance unit I specify on the EllipseShape call?
Thanks for any help that you can provide.
Richard
EllipseShape radius does not seem correct on GoogleMapsOverlay
Sorry I always forget to add the images to the post after the are uploaded. Here is the WorldMapKit image
and the Google image is below.
Riichard
Hi Richard,
The polygon render correct, that’s because each vertex have been reprojection.
But if you only set center point and radius, the EllipseShape won’t works well. Please try build the ellipse shape under 4326 then using Proj4 to reprojection it.
Please let me know whether that works for you.
Regards,
Don
Don,
Thanks for the quick response.
After a lot of attempts, I finally figured out how to do what you had suggested. I created the EllipseShape with the centerpoint in latitude/longitude in DecimalDegrees and the GeographyUnit.DecimalDegrees. Then I called the ConvertToExternalProjection using the proj4.ConvertoExternalProjection(BaseShape ellipseShape). This return the BaseShape with the unit in Meters for the GoogleMaps projection. The radius is now similar although the Ellispe is oval shaped for the DecimalDegrees maps and a circle for the GoogleMaps.
Thanks for the help.
Richard
Hi Richard,
I am glad to hear that works for you!
Thanks for your share about how to solve the problem.
Any question please let us know.
Regards,
Don