diff --git a/demo/complex-example-data.ttl b/demo/complex-example-data.ttl index 3fa28a9..ebf048d 100644 --- a/demo/complex-example-data.ttl +++ b/demo/complex-example-data.ttl @@ -18,12 +18,12 @@ example:4f2a8de3-9fc8-40a9-9237-d5964520ec54 schema:width 200 ; dcterms:spatial [ a dcterms:Location ; - geo:asWKT "POLYGON((52.37900504575066 13.06382134836241,52.37896794299019 13.063796707503286,52.37875635638159 13.063798350228126,52.37875435081642 13.063926482692182,52.378964934657034 13.0639281254158,52.37900404297392 13.063905127281544,52.37900504575066 13.06382134836241))"^^geo:wktLiteral ; + geo:asWKT "POLYGON((13.06382134836241 52.37900504575066,13.063796707503286 52.37896794299019,13.063798350228126 52.37875635638159,13.063926482692182 52.37875435081642,13.0639281254158 52.378964934657034,13.063905127281544 52.37900404297392,13.06382134836241 52.37900504575066))"^^geo:wktLiteral ; dcterms:description "Building has been realized here" ; ] ; dcterms:spatial [ a dcterms:Location ; - geo:asWKT "POINT(50.09895428462539 8.681927539753275)"^^geo:wktLiteral ; + geo:asWKT "POINT(8.681927539753275 50.09895428462539)"^^geo:wktLiteral ; dcterms:description "Model is stored here" ; ] ; prov:qualifiedAttribution [ diff --git a/demo/index.html b/demo/index.html index 93d886f..a25fb55 100644 --- a/demo/index.html +++ b/demo/index.html @@ -11,7 +11,7 @@ diff --git a/src/plugins/mapbox.ts b/src/plugins/mapbox.ts index 157cfdc..cc68bfe 100644 --- a/src/plugins/mapbox.ts +++ b/src/plugins/mapbox.ts @@ -160,7 +160,7 @@ export class MapboxPlugin extends Plugin { if (pointCoords?.length == 2) { const xy = pointCoords[1].split(' ') if (xy.length === 2) { - return { type: 'Point', coordinates: [parseFloat(xy[1]), parseFloat(xy[0])] } + return { type: 'Point', coordinates: [parseFloat(xy[0]), parseFloat(xy[1])] } } } const polygonCoords = wkt.match(/^POLYGON[(]{2}(.*)[)]{2}$/) @@ -173,7 +173,7 @@ export class MapboxPlugin extends Plugin { for (const coord of split) { const xy = coord.split(' ') if (xy.length === 2) { - outer.push([parseFloat(xy[1]), parseFloat(xy[0])]) + outer.push([parseFloat(xy[0]), parseFloat(xy[1])]) } } return { type: 'Polygon', coordinates: coords } @@ -183,9 +183,9 @@ export class MapboxPlugin extends Plugin { geometryToWkt(geometry: Geometry): string { if (geometry.type === 'Point') { - return `POINT(${geometry.coordinates.reverse().join(' ')})` + return `POINT(${geometry.coordinates.join(' ')})` } else if (geometry.type === 'Polygon') { - return `POLYGON((${geometry.coordinates[0].map(item => { return item.reverse().join(' ') }).join(',')}))` + return `POLYGON((${geometry.coordinates[0].map(item => { return item.join(' ') }).join(',')}))` } else { return '' }