Spatial Type singleton. More...
Import Statement: | import ArcGIS.AppFramework.Sql 1.0 |
Properties
- projectionDataPaths : QStringList
- spatialReferenceDatabase : SqlDatabase
Signals
Methods
- clearProjectionCache()
- object geometry(var data)
- ST_Point point(string text)
- ST_Point point(qgeocoordinate coordinate)
- ST_Point point(double x, double y)
- ST_Point point(double x, double y, int srid)
- ST_Projection projection(int srid)
- var spatialReference(int srid)
Detailed Description
The ST (Spatial Type) component contains methods for geometry construction and projection. This is a singleton component, meaning it does not need to be instantiated.
This code sample imports a spatial reference system from SqlDatabase into ST, by writing it into the spatialReferenceDatabase property. A specific record is then printed into the console log using the spatialReference method.
Item { SqlDatabase { id: db databaseName: ":memory:" } Component.onCompleted: { db.open(); db.query( [ "CREATE TABLE SPATIAL_REF_SYS ( ", " SRID INTEGER NOT NULL PRIMARY KEY,", " AUTH_NAME VARCHAR(256),", " AUTH_SRID INTEGER,", " SRTEXT VARCHAR(2048),", " PROJ4TEXT VARCHAR(2048)", ");" ].join("\n") ); db.query( [ "INSERT into spatial_ref_sys ", "(srid, auth_name, auth_srid, proj4text, srtext) ", "values ( ", "94326, ", "'epsg', ", "4326, ", "'+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs ', ", "'GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]]');", ].join("\n") ); ST.spatialReferenceDatabase = db; console.log(JSON.stringify(ST.spatialReference(94326), undefined, 2)); // The expected console output from this code sample: // { // "AUTH_NAME": "epsg", // "AUTH_SRID": 4326, // "PROJ4TEXT": "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs ", // "SRID": 94326, // "SRTEXT": "GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]]" // } db.close(); } }
Property Documentation
Search paths containing a list of directories for init and grid shift files.
spatialReferenceDatabase : SqlDatabase |
Reads or sets the SQLite database containing the Open Geospatial Consortium (OGC) spatial_ref_sys table.
Signal Documentation
Signal emitted when the spatial reference database has changed.
Note: The corresponding handler is onSrsDatabaseChanged
.
Method Documentation
Creates a geometric object.
The data parameter
The geometric object created.
Attempts to return a new Point geometry. If unsuccessful, returns an invalid point.
The text parameter
Well-known text (WKT) representation of a point geometry.
Returns a new Point geometry from a QtPositioning coordinate.
The coordinate parameter
A coordinate value from QtPositioning.
Returns a new Point geometry defined by the x and y parameters.
The x parameter
The x (latitude) value of the point.
The y parameter
The y (longitude) value of the point.
Returns a new point geometry defined by the x, y, and spatial reference parameters.
The x parameter
The x (latitude) value of the point.
The y parameter
The y (longitude) value of the point.
The srid parameter
The spatial reference of the returned point.
Returns the projection associated with the given spatial reference ID. If spatial reference ID is invalid, returns null.
The srid parameter
The spatial reference ID of the projection.
Retrieves a record from the spatial_ref_sys table from the spatialReferenceDatabase as an object.
The srid parameter
The spatial reference to look up.