DisyInformationssysteme / Cordova-spatialite-storage

A Cordova/PhoneGap plugin to open and use sqlite databases on Android/iOS/Windows Universal(8.1)/Amazon Fire-OS/WP(7/8) with HTML5/Web SQL API
Other
24 stars 17 forks source link

ionic 3: spatialite query not working as expected #11

Open Naseer-Ahmad opened 5 years ago

Naseer-Ahmad commented 5 years ago

Hi everyone, @Cultrarius i'm facing issue in running query.

Problem

Query retuns all the rows in success it should return only 1 record, i can successfully run the query in PostGis(Postgres).

Spatial-lite Query tx.executeSql("SELECT geom_wkt FROM features WHERE ST_Contains(features.geom_wkt, ST_GeomFromText('POINT(-13558733.646749694 4510524.920627141)', 3857))",[],(tx, res)=>{ console.log(res,tx); },(tx, error)=>{ console.log(error); });

Table Structure | row_id | geom_wkt | ctrd_point |

Example data in ctrd_point

POINT (-13548660.73716953 4512826.116309432) Example data in geom_wkt

MULTIPOLYGON (((-13548685.1414 4510686.1853, -13549643.7651 4510677.834399998, -13549644.0297 4510722.523100004, -13549648.2205 4511680.982299998, -13548688.3625 4511703.584399998, -13548685.1414 4510686.1853)))

Thanks!