Questions tagged [well-known-text]

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
99 votes
4 answers
193k views

Getting coordinates from geometry in PostGIS

This line: SELECT geom FROM myLayer.geom will return a hex value. How would I get decimal values, which is a human-readable coordination?
Kourosh's user avatar
  • 1,299
87 votes
6 answers
60k views

Visualising WKT geometry string in QGIS

Is there a simple tool in QGIS to graphically visualise geometry formatted as text? Example geometry: POLYGON((571178 6337246,571178 6402217,598061 6402217,598061 6337246,571178 6337246)) Result: A ...
Chau's user avatar
  • 4,480
52 votes
14 answers
153k views

Online WKT and GeoJSON viewer

I once found a great but simple webpage that has a drop-down with several text-based GIS formats such as GeoJSON and WKT, and a text box to copy/paste your data. The feature is then drawn on a world ...
JPhi's user avatar
  • 631
28 votes
8 answers
35k views

Calculating area in km² for Polygon in WKT using Python

I have polygons in WKT that looks like this POLYGON ((24.8085317 46.8512821, 24.7986952 46.8574619, 24.8088238 46.8664741, 24.8155239 46.8576335, 24.8085317 46.8512821)) I would like to calculate the ...
amaatouq's user avatar
  • 441
23 votes
1 answer
11k 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 ...
Devdatta Tengshe's user avatar
17 votes
6 answers
13k 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 ...
Petr Krebs's user avatar
  • 10.3k
17 votes
2 answers
28k 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 ...
fgcarto's user avatar
  • 1,524
16 votes
4 answers
11k 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 ...
Cui Pengfei 崔鹏飞's user avatar
15 votes
4 answers
17k 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-...
RyanKDalton's user avatar
  • 23.1k
15 votes
5 answers
34k views

Converting 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)), ((...
Gregory's user avatar
  • 1,661
15 votes
2 answers
34k 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 ...
Pure.Krome's user avatar
  • 1,793
14 votes
6 answers
3k views

Is there a way in QGIS 3 to get a selected feature WKT?

In QGIS 2.x, I used the getWkt plugin: https://github.com/hugoledoux/QGIS-getWKT to get a WKT of a selected feature. But that plugin isn't present in QGIS 3.x. Was that capability built into core ...
Jay Cummins's user avatar
  • 14.6k
14 votes
2 answers
21k 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 ...
Phillip Money's user avatar
14 votes
1 answer
22k 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 ...
user3520314's user avatar
13 votes
1 answer
14k views

Converting geoalchemy2.elements.WKBElement to WKT

I have a geoalchemy2.elements.WKBElement that comes from a query on a Postgres/PostGIS view. I want to convert this to WKT, or otherwise encode it so that it is (Geo)JSON serialisable. How can I ...
alphabetasoup's user avatar
12 votes
6 answers
9k views

WKB to WKT JavaScript function

Turns out json isn't so good at transporting binary data. But with HTML5, XHR2 is now capable of transferring blobs cleanly. I'm looking to transfer binary geometry (to save bandwidth) and decode it ...
Jordan Arsenault's user avatar
12 votes
5 answers
7k 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 ...
Adam Matan's user avatar
  • 6,838
12 votes
2 answers
11k views

Quick way to get WKT from a GeoDataFrame's geometries in GeoPandas?

Is there a quick way to produce a column/series containing the WKTs of all the geometries in a GeoPandas GeoDataFrame? I got around this using the apply function (see example below), but I just ...
Felipe D.'s user avatar
  • 2,509
11 votes
6 answers
28k views

Converting WKB to WKT

How can I convert WKB to WKT form? I stored coordinates in WKB but now I want to display it using WKT form.
tina's user avatar
  • 333
11 votes
3 answers
16k views

Is there any efficient way to convert GeoJSON to WKT?

I want to use ST_GeomFromText() to load vector data to PostGIS. However, I don't know how to convert from GeoJSON type to WKT. N.B. I know I can use OGR2OGR to upload the GeoJSON directly, but I just ...
Yu Guo's user avatar
  • 639
11 votes
4 answers
6k 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 ...
Karim Bahgat's user avatar
10 votes
5 answers
6k 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 ...
Mike Furlender's user avatar
10 votes
2 answers
17k 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 ...
mhermans's user avatar
  • 335
10 votes
1 answer
7k 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 ...
timmy's user avatar
  • 193
10 votes
1 answer
1k views

Differences between OGC and ISO WKT/WKB specification?

Are the OGC-Simple feature access and the ISO (ISO/IEC 13249-3:2011 "Information technology - Database languages - SQL multimedia and application packages - Part 3: Spatial") significantly different (...
Jay Cummins's user avatar
  • 14.6k
9 votes
2 answers
30k views

How to return WKT of entire polygon with shapely?

Im learning to use shapely and have two shapefiles--forest, and basins. The two shapefiles clearly intersect (basins is completely within forest). But the way I've gone about it only gets the feature ...
Alex R's user avatar
  • 315
9 votes
1 answer
22k 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....
Pliny's user avatar
  • 101
9 votes
2 answers
4k views

What's this PROJ4 string in WKT?

I have this projection in PROJ4: +proj=tmerc +lat_0=41.836944 +lon_0=-87.684722 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs What's the WKT translation? I saw this site: http://cfconventions.org/...
Ben Cooper's user avatar
8 votes
2 answers
2k views

Converting geometry to WKT format by using QGIS Expression

I have a gpkg file and I am changing the geometry to wkt format by using expression geom_to_wkt( $geometry ) in the Field Calculator. The output looks like this in the image. The geometry type is not ...
Nil's user avatar
  • 1,517
8 votes
2 answers
4k views

How to get WKT from a QgsGeometry object?

How can I get the wkt from a geometry object in python? I'd like to be able to do something like the following: from qgis.core import * import qgis.utils layer = qgis.utils.iface.activeLayer() for ...
Everyone_Else's user avatar
8 votes
1 answer
2k views

Export geography field from SQL for use in GIS

I currently have a table in SQL server management studio (2012) with a geography column. It definitely has valid spatial data, as I can view it in SSMS: What I want is to export the data as a ...
Joshua Kidd's user avatar
8 votes
1 answer
6k views

PostGis vs Oracle Spatial 11g performance

I am having a performance issue updating a table in Oracle Spatial 11G while converting 63,000,000 points to WKT format. I also made a comparison with Postgres. Both Postgres and Oracle run in two ...
w4bo's user avatar
  • 199
7 votes
5 answers
14k 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. But ...
swiss_knight's user avatar
  • 10.3k
7 votes
4 answers
19k views

Converting WKT to GeoJSON with Leaflet

I have a point-type WKT geometry column in a MySQL table storing the location of some stores. I want to display it on a Leaflet map on my website. I've found plenty of tutorials for doing this on ...
Samy-DT's user avatar
  • 173
7 votes
3 answers
4k views

Determine if a polygon intersects itself in OpenLayers

I let the users draw polygons and then I try to save them out to the SQL Server 2008 SQLGeography field, but it is giving me an error: Error 24200: The specified input does not represent a valid ...
Eric Packwood's user avatar
7 votes
3 answers
3k views

.NET library to convert KML to WKT?

Anyone know of a free OpenSource .NET library i could use to convert KML to WKT? I know i can use openlayers and there are many JavaScript possibilities, but i need to do this on the back-end.
CaptDragon's user avatar
  • 13.3k
7 votes
2 answers
9k views

How to read csv with WKT geometry in Arcmap?

I have found several parcels I need on a county map viewer. However, the only option to download any of the data is found on a click context menu to "Copy selection as csv" which gives me this: HGID,...
Krausers's user avatar
  • 544
7 votes
2 answers
2k views

Convert WKT coordinate reference system to PROJ4

I'm currently working on a better support of LAS 1.4 file format in the rlas R package. In LAS 1.4 format the CRS of the point cloud can be stored as a WKT string. For example this is what I read from ...
JRR's user avatar
  • 9,399
7 votes
1 answer
6k 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 ...
Basile's user avatar
  • 3,543
7 votes
1 answer
2k views

Understanding EPSG in WKT

I notice several EPSG codes in one WKT. At the first glance it almost is non-intuitive to see so many EPSG codes linked to a single EPSG. Can someone explain each line of the following WKTs for EPSG:...
GISEnthu's user avatar
7 votes
1 answer
15k views

Parameter values to create a vector grid with 1km x 1km cells?

I created a shapefile from WKT in QGIS using the values from this link. I want to create a vector grid with 1kmx1km cells but I can't figure out what values need to be set for the X and Y parameters. ...
bcosynot's user avatar
  • 171
7 votes
1 answer
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["...
M Katz's user avatar
  • 503
7 votes
1 answer
773 views

Where are the WKT types CIRCULARSTRING, COMPOUNDCURVE etc actually defined?

I'm trying to find the actual definition of the curve types supported by PostGIS in WKT. PostGIS's documentation refers to the " SQL Multimedia Applications Spatial specification": The SQL ...
Steve Bennett's user avatar
7 votes
1 answer
3k views

loading a CSV with an embedded GeoJSON polygon geometry in QGIS

This open data portal offers download as CSV file. For larger datasets, that's the only way to download the whole dataset in one go. The CSV format is pretty creative: the polygon geometry is in ...
joost schouppe's user avatar
7 votes
1 answer
1k 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 ...
user34739's user avatar
6 votes
4 answers
4k views

Getting correct WKT result to 4 decimal places using PostGIS

I'm using PostGIS version 2.3. I want to get the SW and NE corners of a bounding box, corrected to 4 decimal places. Right now I have this to retrieve the SW and NE corners from my geometry column: ...
Richard's user avatar
  • 3,289
6 votes
3 answers
5k 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 ...
displayName's user avatar
6 votes
2 answers
6k views

Adding field with geometry in WKT format in QGIS

I have a shapefile with polygons and want to add an attribute field with the WKT in QGIS 3.4. The function geom_to_wkt() in the Field Calculator isn't working and I don't know how to do it. Any ideas?
Elena Lopez's user avatar
6 votes
2 answers
2k views

gdalwarp cutline without using a shapefile

I'm currently working with gdalwarp to split some tiffs. gdalwarp -cutline file.shp -dstalpha -of GTiff image.tif split_image.tif I wanted to know if I can use an other source rather than use a ...
Geek Junior's user avatar
6 votes
1 answer
2k views

How to generate WKT geometries from true type font glyphs (python)

Does anyone know of a library or tool ( preferrably Python)to convert true type font glyphs into polygonal shapes (for testing GIS algorithms)?
MartinT's user avatar
  • 876

1
2 3 4 5
9