0

My points data (hull) is in EPSG:32651, i want my output to be in EPSG:4326 so that it will display on my map. How will I do it. I've seen some similar question but they are using version 3.x. I'm guessing its different on 7.x.

 var vectorSource3 = new ol.source.Vector({
            features: (new ol.format.GeoJSON({
            })).readFeatures(hull)
        });

1 Answer 1

1

Just as in version 3 you will need to define the EPSG:32651 projection and specify the data and display projections when parsing the data. The only change is you must now register proj4 after the defining the projection

proj4.defs('EPSG:32651','+proj=utm +zone=51 +datum=WGS84 +units=m +no_defs +type=crs');
ol.proj.proj4.register(proj4);

 var vectorSource3 = new ol.source.Vector({
            features: (new ol.format.GeoJSON({
            })).readFeatures(hull, {
                dataProjection: 'EPSG:32651',
                featureProjection: 'EPSG:4326',
            })
        });

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.