Texonom
Texonom
/
Application
Application
/Geology/GIS/Map/Map Tools/2D Map/OpenLayers/OpenLayers Format/
OL GeoJSON
Loading views...
Search

OL GeoJSON

Created
Created
2021 Mar 26 1:15
Tags
Tags
import GeoJSON from 'ol/format/GeoJSON'
 
 

geojson to feature

const features = new GeoJSON({ dataProjection: 'EPSG:4326', featureProjection: 'EPSG:3857' }).readFeatures(json)
 
 
 

feature to geojson

const features = new GeoJSON().writeFeature(json)
 
 
 
 
Class: GeoJSON
Maximum number of decimal places for coordinates. Coordinates are stored internally as floats, but floating-point arithmetic can create coordinates with a large number of decimal places, not generally wanted on output. Set a number here to round coordinates. Can also be used to ensure that coordinates read in can be written back out with the same number of decimals.
Class: GeoJSON
https://openlayers.org/en/latest/apidoc/module-ol_format_GeoJSON-GeoJSON.html
Class: GeoJSON
 
 
 
 

Recommendations

Texonom
Texonom
/
Application
Application
/Geology/GIS/Map/Map Tools/2D Map/OpenLayers/OpenLayers Format/
OL GeoJSON
Copyright Seonglae Cho