Questions tagged [wkt]

Well-known text (WKT) is a text markup language for representing vector geometry objects on a map, spatial reference systems of spatial objects and transformations between spatial reference systems.

Filter by
Sorted by
Tagged with
3
votes
3answers
2k views

I have a list of coordinates that make up a route - how can I easily render this shape on a map?

Additional info - I don't need this to be on a map - I just need the shape of the route. Is there anything that can return that shape easily? The list of coordinates are in an XML document and I'd ...
4
votes
1answer
4k views

QGIS, WKT (Well Known Text) LINES and POLYGON files loaded ok, but POINT not

I have several files in WKT format, and something strange happens when I import them in QGIS (v.2.18.1) (layer->add layer->add delimited Text Layer), files containing lines and polygons are correctly ...
0
votes
2answers
2k views

Converting WKT to WKB in Java using PostGIS?

How can I convert a WKT string to a WKB byte[] in Java using PostGIS functions? I need to save that WKT string in a PostGIS database (geometry column.
2
votes
0answers
43 views

3D wkt geometries - Parse in .Net suggests alternate form

I am having some issues with a built in .net framework class (System.Data.Spatial.DbGeometry in assembly System.Data.Entity). It turns out that this class cannot parse 3D geometries when they are ...
2
votes
1answer
371 views

Error when writing SHAPE to WKT with pyqgis and QGIS 2.14

It seems the answer linked here doesn't work in latest version of QGIS 2.14 layer = QgsVectorLayer("/home/reyman/Projets/cours/coursPython/pyQgis/shape/passages/passages.shp", "passages", "ogr") if ...
2
votes
1answer
1k views

Extract vertices from dbgeometry value

Who knows the elegant way to extract coordinates of polygon vertices from well known text representation of DbGeometry value? Here's my polygon for example: {POLYGON ((52.808019 -1.345367, 53....
1
vote
1answer
168 views

Python To PostgreSQL - ST_GeometryFromText and NaN

I am trying to import a shapefile into Postgre using python and psycopg2. I have run into a few issues. I am using ST_GeometryFromText() of a WKT string. First, the shape@WKT returns MULTIPOLYGON ...
3
votes
1answer
198 views

Is there a DWG geometry type that cannot be expressed using WKT?

Is there a geometry type (both 2D and 3D) that is supported by DWG and cannot (lossless-ly) be expressed using Well-Known Text? If there is, please provide an example.
3
votes
1answer
648 views

PostGIS linestring to shapefile error with shapely/fiona

I have a PostGIS layer with linestring and I am trying to write the layer to shapefile using fiona and shapely. Here is what I have so far: from shapely.geometry import mapping,LineString from ...
1
vote
0answers
573 views

Convert WKT to EWKB/WKB using GDAL/OGR? [closed]

How do I convert WKT geometry to EWKB/WKB? Here's my WKT: POLYGON ((113.749421064162419 62.38697568386327,113.754636282390067 62.386872575140529,113.755323673085357 62.334314115202005,113....
3
votes
1answer
543 views

Get EPSG code or CRS name from Proj4 WKT

I am trying to get the EPSG code from a proj4 WKT. :“+proj=lcc +lat_1=46.183333333 +lat_2=47.483333333 +lat_0=45.666666667 +lon_0=-100.5 +x_0=600000 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs” But I ...
1
vote
1answer
1k views

Convert OL3 drawn polygon to WKT for inserting to PostGIS

Essentially what I am trying to accomplish is to have a map where the user can draw a geometry, fill in a form and have the record, along with the geometry, saved to PostGIS. I'm new to Javascript (...
0
votes
2answers
553 views

Arcpy Create Polygon Geometry or Shapefile/FeatureLayer from WKT

I have a polygon feature class that i am looping through row by row. I want to take each row/record and create it into its own Polygon Geometry or Shapefile/FeatureLayer using WKT PolygonGeometry ...
2
votes
2answers
86 views

Preparing geometry for psycopg2 using ArcPy without SHAPE@WKT?

Trying to print out a polygon shapefile in WKT format in a standalone script. I am using ArcGIS 10.1 and use the da modules all the time. I have seen this post Converting geometry to WKT using ArcPy? ...
1
vote
1answer
269 views

Arcpy to PostgreSQL using psycopg2 with MULTIPOLYGON using WKT

I am trying to create a MULTIPOLGYON in PostgreSQL from WKT format using arcpy.da module and psycopg2. I have had success creating point and multi point shapes this way however I cannot seem to get ...
13
votes
4answers
11k views

Converting geometry to WKT using ArcPy?

I would like to be able to convert a single feature (or potentially many features) in an ArcGIS layer into Well Known Text (WKT) format during a geoprocessing operation using Python and ArcPy (no non-...
3
votes
1answer
251 views

Information on WKT definition file

In a well known text definition file of a geolocated image (or whatever else it does) we find this: PROJCS["UTM_Zone_19_Northern_Hemisphere",GEOGCS["GCS_WGS_1984",DATUM["D_WGS84",SPHEROID["WGS84",...
7
votes
1answer
686 views

Is there a limit to the number of polygon points you can export to CSV in QGIS 2.4?

Using QGIS 2.4 I am currently importing a csv file with ~30,000 polygons (polygons in WKT format). I also have a United States shapefile. I have used the Clip function to get only the polygons that ...
0
votes
1answer
185 views

ST_Intersects with EWKB

I am working in a Django and have done a query to get a list of geometries from a table. I want to iterate through that list and insert them into my new query. My notional polygon is: ...
0
votes
1answer
113 views

Showing WKT multipolygon in Mapserver results msGEOSError?

I have multipolygon WKT and I want to show it as a layer in Mapserver, I followed Mapserver as in this link http://mapserver.org/mapfile/feature.html but I can see it didn't mention MULTIPOLYGON as ...
0
votes
1answer
486 views

Converting points from MySql database to WKT lines using PHP?

In MySql database I have points (pairs of latitudes and longitudes represented as doubles) like this: LATITUDE | LONGITUDE ---------|---------- 45.045664| 46.084528 26.938933| 60.903848 ..... ...
8
votes
2answers
8k views

Converting KML files for use with Python library Shapely

I am trying to get a KML-file (wijken.kml) into Shapely. The KML-file is validated against the proper XML schema, so I guess the input is correct. Routes I have tried: 1) Converting to WKT or WKB ...
1
vote
1answer
665 views

How to calculate cell tower polygon and get the coordinates in wkt format

I have an use-case where I have to calculate the polygon of cell tower and store the polygon information in wkt format. I have got the following information regarding a cell tower. latitude longitude ...
6
votes
1answer
1k views

How to find the actual projection name (code) in a PROJCS text data?

Given a PROJCS data PROJCS["unnamed", GEOGCS["WGS 84", DATUM["WGS_1984", SPHEROID["WGS 84",6378137,298.257223560493, AUTHORITY["EPSG","7030"]], ...
7
votes
1answer
8k views

Loading WKT polygons into QGIS

I have downloaded a file showing the status of the National Broadband Network. The CSV file contains a field "Development Shape", which contains "POLYGON ((153.101112401 -27.797998206, 153.097860177 ...
4
votes
1answer
2k views

Export geometry to WKT using pyshp

Is there a straight method to export shapefile geometry (polygon) to WKT using pyshp module for python? I was looking for something similar to OGR's .ExportToWkt() method, but it seems like there's ...
1
vote
1answer
1k views

Set background color and opacity for a WKT layer vector in OpenLayers3

I have this function: function drawLayer(wktRegion, name,colour = "transparent"){ var format = new ol.format.WKT(); var feature = format.readFeature(wktRegion); feature.getGeometry()...
2
votes
1answer
1k views

What is the difference between ST_GEOMETRY and WKT?

What is the difference between ST_GEOMETRY and WKT? Is ST_GEOMETRY just a database type and WKT (well-known text) is a textual representation of the data?
0
votes
1answer
153 views

PostGIS Unknown Coordinates Format

I've turned a shapefile into a postgis table using shp2pgsql-gui. Then, i wanted to get the coordinates of geom column, for that i converted geom to WTK throught ST_AsText(geom) function. The ...
10
votes
1answer
4k views

Help with PostGIS polygon geometry - non-closed rings

I've picked up a copy of the super-wicked book 'Python Geospatial Development' by Erik Westra (Amazon link), and I'm working through it. Currently, it's teaching me to load GSHHS coastline data from a ...
0
votes
2answers
247 views

How to convert this geometry location format to a qgis usable format?

I am a beginner with regard to dealing with gis information, so please bear with me. I would be obliged if someone could help. I have data on asssembly constituencies of Delhi, with these ...
1
vote
5answers
6k views

Fix Self Intersecting Polygons Manually [closed]

I are looking to implement a method to fix self-intersecting polygons by editing the vertex order. We want to take the polygon rings and re-arrange/add in vertices to make a valid polygon. This is ...
0
votes
2answers
503 views

Verify with WKT point is in a polygon SQL

I'm using SQL Server and WKT to deal with geographic data. What I'd like to do is have something like : SELECT pt FROM point_table, polygon_table where pt.point_table WITHIN ply.polygon_table Here ...
4
votes
3answers
281 views

Are nested parenthesis allowed in MultiPoint WKT?

I'm writing a basic parser for common WKT. The Wikipedia entry for Well-known text says that both of these are equivalent. MULTIPOINT (10 40, 40 30, 20 20, 30 10) MULTIPOINT ((10 40), (40 30), (20 ...
2
votes
3answers
2k views

Iterating polygons on a SpatialPolygonsDataFrame in R with readWKT

I have fetched some data (39 objects) from my PostGIS database and converted this data into a matrix: rs <- dbSendQuery(con, "SELECT ST_AsText(polygon_accumulation) AS ShapeWKT from accumulation;")...
1
vote
1answer
651 views

Finding all polygons inside of a polygon

How to find all the polygons inside of a polygon? I tried ST_Intersects and ST_Contains but they are booleans variables. I have a list of polygons in WKT format, so I am trying to pull all the ...
1
vote
1answer
415 views

ST_Transform error

I am getting an error from ST_Tranform while using ST_Intersection: No function matches the given name and argument types. You might need to add explicit type casts. select ST_Intersection(...
1
vote
0answers
382 views

Getting H2GIS functions to work in Spherical Space?

I've been playing around with H2GIS (http://www.h2gis.org/) for a project at work and am struggling to get the H2 functions to operate in spherical space (lat/ lon), rather than cartesian space. The ...
1
vote
1answer
760 views

QGIS How to draw lines from two points in a CSV?

I have a largely identical query to How to draw lines from two points in a CSV?, however the solution listed isnt working for me. My original text format is PID, Start Northing, Start Easting, End ...
4
votes
1answer
2k views

Converting wkt to geojson with OpenLayers

I am trying to convert wkt to geojson wiht OpenLayers. I wrote my code based on this question (geojson to wkt). That's what I have so far, but it is not working. Any ideas? var = '...
2
votes
1answer
367 views

How to copy the geometry WKT from a temporary scratch layer in QGIS?

It seems in the 2.14.2 version of QGIS the ability to copy the WKT from the geometry of a temporary scratch layer has been removed. Previously you could create, for example, a new polygon feature in ...
5
votes
3answers
3k views

How to get WKT for various Spatial Reference Systems?

I need to provide WKTs of spatial reference systems in the APIs provided by GDAL/OGR. Is there some specific place where I can look for WKTs of the spatial reference systems that I'm working with? Or ...
3
votes
1answer
203 views

PostGIS: floating point representation problem with ST_AsText

I have a table with geometries, all with about 13 digits of accuracy. While trying to represent them with ST_AsText though, most vertices come out in decimal notation, but some come out in scientific ...
3
votes
1answer
285 views

Problem with precision when convert from WKT to shapefile

I have a problem with converting from WKT to shapefile in pygdal. In wkt I have fields with precision (for example real 7.2). When I create a shapefile I have field numeric with no precision (numeric ...
2
votes
0answers
155 views

GDAL c# API returned different WKT from gdalinfo

I've found completely different results in WKT strings while using gdalinfo utility and method from c# API GetProjectionRef(). In the first case the result was: PROJCS["WGS 84 / Pseudo-Mercator", ...
19
votes
1answer
9k views

Where can I find the WKT standard or reference?

I had a little confusion about the representation of a geometry as well-known-text (WKT). I was searching for the WKT Specs to search for the exact representation, but I did not find the Standard. Is ...
2
votes
1answer
817 views

Geoserver projection recognize problem

I'm publishing shape files in geoserver through curl,my problem is that geoserver didn't recognizing the projection which is in ESRI WKT format(layer was publishing).I searched for this problem i ...
1
vote
0answers
227 views

Proj4 WKT - Cartesian with origin to EPSG900913

I'm converting wgs84 to cartesian with origin using simple function in c# public static double[] LL_TO_XY(double latitude, double longitude, double originLatitude, double originLongitude) { ...
1
vote
2answers
196 views

What is the format for OSM lat/lon in .osm/.osh files and how to import correctly into PostGIS?

I've been having issues converting OpenStreetMap geometries to valid points in PostGIS. MY PostGIS table has the this definition for the geom column: SELECT AddGeometryColumn('node','geom',900913,'...
8
votes
1answer
17k views

What's the proper format for WKT linestrings when importing into QGIS?

I'm trying to run the following test CSV through the Delimited Text plugin as WKT data: oid,Line 1,LINESTRING((45.554194 -122.686101, 45.433001 -122.762632)) 2,LINESTRING((45.432505 -122.598327, 45....