private static final SpatialReference SPATIAL_REF_WGS84 = SpatialReference.create(4326); ... public static Geometry projectGeometryWGS84ToMap(Geometry geometryWGS84, SpatialReference spatialRefMap) throws ReprojectException { Geometry result; try { if (spatialRefMap != null && SPATIAL_REF_WGS84.getID() != spatialRefMap.getID()) { // reproject here result = GeometryEngine.project(geometryWGS84, SPATIAL_REF_WGS84, spatialRefMap); } else { // map is already in WGS 84 result = geometryWGS84; } } catch (ArrayIndexOutOfBoundsException e) { // In case of Polygon, I face this kind of Exception sometimes... but don't know why throw new ReprojectException ... } return result; }
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.