Open mborne opened 1 month ago
import WKTReader from 'jsts/org/locationtech/jts/io/WKTReader.js'
import GeoJSONReader from 'jsts/org/locationtech/jts/io/GeoJSONReader.js'
import {DistanceOp} from 'jsts/org/locationtech/jts/operation/distance.js'
const wktReader = new WKTReader();
const geojsonReader = new GeoJSONReader();
const gA = geojsonReader.read({
"type": "Point",
"coordinates": [-1.0,0.0]
});
const gB = wktReader.read('POLYGON((0 0, 0 10, 10 10, 10 0, 0 0))');
console.log(DistanceOp.distance(gA,gB));
Context
Some screenshots will be required to explain the limits of the "magic"
Limits