mborne / geocontext

[DEV] An experimental API providing spatial context for LLM.
MIT License
1 stars 0 forks source link

Document sample prompt and limits #2

Open mborne opened 1 month ago

mborne commented 1 month ago

Context

Some screenshots will be required to explain the limits of the "magic"

Limits

mborne commented 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));