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
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-...
62
votes
4answers
34k views

Visualising WKT geometry string in QGIS

A very simple question: Is there a simple tool in QGIS to graphically visualise geometry formatted as text? Example geometry: "POLYGON((571178 6337246,571178 6402217,598061 6402217,598061 ...
14
votes
2answers
17k views

Seeking online WKT editor?

We need to do are very simple administrative boundary drawings over a (insert fav map here) via some website. Our requirements are: click to create points which then form a polygon drag existing ...
12
votes
2answers
20k views

Creating CSV with geometry as WKT in QGIS (with choosing field delimiter)

Is there a way to choose the field delimiter when exporting a CSV with geometry as wkt in QGIS? I have a shapefile with donut holes and I'd like to export it as a CSV. It's for a partner whose DB ...
17
votes
6answers
11k views

Converting between Esri Geometry and WKT using ArcObjects?

It seems like there is no means of converting an ArcObjects geometry to the Well-Known Text representation (and vice versa) in ArcGIS ArcObjects API. The only thing I was able to find is conversion to ...
7
votes
1answer
16k 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....
9
votes
4answers
4k views

How are ESRI WKT projections different from OGC WKT projections?

Does anyone know the precise list of differences between ESRI WKT and OGC WKT projection format strings? I know there are various tools to help convert from ESRI WKT to OGC WKT, including GDAL ...
2
votes
1answer
822 views

WKT for local mine grid

I have been trying to create a WKT entry to use in gdalwarp etc. I need an affine transform from coordinates in MGA94 Zone 54 to our local mine grid. All efforts have so far failed, including using ...
13
votes
4answers
6k views

What is the best way to programmatically convert between WKT and Proj4 string?

Some shapefiles have a .prj file associated with it, and the .prj file contains the projection info of the shapefile in the format of WKT. Sometimes I need to convert WKT to proj4 string, and ...
8
votes
1answer
10k views

Understanding the format: WKB from WKT and how to convert the first into the latter [closed]

I don't understand which kind of format I have my data. The column name is wkb_geom, so I supposed that data were in WKB format, but then I was checking around and I couldn't find example of it. Data ...
6
votes
5answers
16k views

How to convert WKB to WKT?

how can i convert wkb to wkt form ... i stored coordinates in wkb but now can it will display to use in wkt form
12
votes
2answers
21k views

How to convert a shapefile to WKT?

I'm trying to convert a shapefile into the simple Well Known Text (WKT) format in the example below (from http://en.wikipedia.org/wiki/Well-known_text). MULTIPOLYGON (((40 40, 20 45, 45 30, 40 40)), (...
4
votes
1answer
2k views

Write out a WKT file from a loaded shapefile

We are looking to load and display a shapefile, simple polygons, then write out a WKT string of that shapefile and have the user save it somewhere. Does anyone have some code snippets of that very ...
8
votes
2answers
7k 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 ...
4
votes
5answers
5k views

Converting WKT to SHP?

I have a text file containing exactly this: POLYGON ((6.2973716 48.98613 1772.1, ... many other Long Lat Altitude values ... )) And only this. It seems to be just like a WKT geometry of a polygon. ...
2
votes
1answer
2k views

WKT: What is the reasoning behind the concept of a POINT EMPTY?

In data formats like WKT and WKB, we have ways of representing "empty" geometries. That all pretty much makes sense: a "LINESTRING EMPTY" is a LINESTRING type with 0 vertices. Same with a MULTIPOINT, ...
2
votes
2answers
403 views

ProjNet. Coordinate reference system transformation deviation

I have a project with C# that contains a CEFSharp viewer showing a webpage with a map that I've created.I'm trying to add a marker in the map sending the parameters from C# to a function in the ...
1
vote
1answer
601 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 ...
0
votes
1answer
1k views

get wkt from geometry in lat lon format

Using the plane geometry editor plugin in qgis 2.0, WKT representation of a feature is shown. The result is in the lon1 lat1,lon2 lat2 format. e.g. POLYGON((85.43523762804622379 27.69592296476042037,...
13
votes
4answers
4k views

Looking for a pythonic way to calculate the length of a WKT linestring

I was quite unsatisfied with Calculating Length of Linestrings in WGS84 in Miles. It kept me wondering if there is a more convenient, Pythonic way to calculate the length of a WKT linestring according ...
4
votes
2answers
2k views

Plotting large numbers of objects on a chart using R and WKT format

I am retrieving thousands of geometry lines in WKT format from a Microsoft SQL Server database. I would like to plot all of those lines in one map, but I am having some difficulty with the code. How ...
7
votes
1answer
2k views

projection/pyproj puzzle, and understanding SRS format

I have a shapefile that has a .prj file, with the following wkt contents: PROJCS["NAD_1927_StatePlane_New_York_West_FIPS_3103",GEOGCS["GCS_North_American_1927",DATUM["D_North_American_1927",SPHEROID["...
5
votes
5answers
1k views

WKT for EPSG:4326 with LON 0 to +360 instead of -180 to +180

I have GRIB2 files that seem to be in a projection similar to EPSG: 4326, except that instead of longitude between -180 and +180 it is between 0 and 360. My intention is to get these files into ...
2
votes
2answers
164 views

Seeking for a solution to convert GeoTIFF to 3d WKT

I am trying to convert some DEM in .tif image to polygon geometries representing 3 dimensional triangles that is Well-known text (WKT) - 3D (x, y, z) I was able to use SAGA to convert my GeoTIFF ...
5
votes
1answer
2k views

What is the best way to convert WKT String to GML String

What is the best way to programatically convert WKT String to GML String? Every reasonable library (at best available in some Maven repository) can be used. Till now I came up with this solution ...
5
votes
1answer
508 views

PostGis and datatypes WKT

I dont't have any experience with the geographics databases so I hope that you be patiente with me, the thing is: I know that the datatype geography is used if all you care about is measuring ...
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 ...
3
votes
4answers
295 views

Plain geometry editor for QGIS 3.0?

In QGIS 2.18, I had been using the plugin "Plain Geometry Editor" to view, copy and paste the WKT geometry of features (as a solution to this question). However, this plugin is not available for QGIS ...
3
votes
3answers
3k views

How do I convert WKT geometry from 3D to 2D

I'm working with kml files using Python gdal.ogr module. When I extract feature's geometry using feature.GetGeometryRef(), I get: POLYGON ((44.184069865521963 41.971859752507207 0,44.355248797385123 ...
2
votes
0answers
551 views

QGIS 2.2 saving layer as CSV with GEOMETRY=AS_WKT not working [closed]

Just upgraded to QGIS 2.2 and it looks like saving a layer as CSV doesn't support GEOMETRY=AS_WKT anymore. The new Layer Options portion of the save dialog is cool but it looks like GEOMETRY and ...
2
votes
1answer
352 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 ...
1
vote
1answer
733 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 ...
1
vote
1answer
388 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
1answer
2k views

Converting GeoJSON to WKT with OpenLayers2

I was just wondering if there was a good way to convert GeoJSONdata to WKT data using OpenLayers. The method I've tried is to create a Feature.Vector with the GeoJson and then tried using WKT.write(...
1
vote
1answer
852 views

What are AGF Files, how do we put them in PostGIS?

I came across term which says AGF, after Googling I found its Autodesk Geo Files, But some other say, Atlas Geo Files, Which one of them is right. I also came to know that It is an extension to WKT ...
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
1answer
2k views

Reproject WKT Polygon with Javascript

I have a polygon in WKT in EPSG:4326: polygonWKT = 'POLYGON((13.215179443359373 52.588032137196755,13.42803955078125 52.592620721000365,13.454132080078125 52.46897854656702,13.347015380859375 52....
0
votes
1answer
961 views

How to convert drawn vector feature from EPSG:900913 to EPSG:4326

My script allows you to drawn shapes on an OpenLayers map, and then to get the WKT information from that shape, except the returned coordinates are in EPSG::900913 and I need them to be in lat/lon.
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.
0
votes
1answer
142 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 ...