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.

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. A binary equivalent, known as well-known binary (WKB) is used to transfer and store the same information on databases, such as PostGIS, Microsoft SQL Server and DB2.

The formats were originally defined by the Open Geospatial Consortium (OGC) and described in their Simple Feature Access and Coordinate Transformation Service specifications. The current standard definition is in the ISO/IEC 13249-3:2011 standard, "Information technology -- Database languages -- SQL multimedia and application packages -- Part 3: Spatial" (SQL/MM).

http://en.wikipedia.org/wiki/Well-known_text

185 questions
11
votes
1 answer

WKT: how do you define Polygons with 3 rings (==2 holes)?

I found in here this document. I read it but I keep wondering how to define a Polygon with 3 rings in WKT?
Rella
  • 65,003
  • 109
  • 363
  • 636
11
votes
5 answers

How to convert WKT to SVG

I have some Well-known text (WKT) for representing geometry object such as Point, MultiPoint, LineString, Polygon, MultiPolygon etc. I have a multipolygon with in total 40000 Points. I have found this plugin to convert SVG to WKT. Is there any…
Jetson John
  • 3,759
  • 8
  • 39
  • 53
10
votes
6 answers

Reformat SQLGeography polygons to JSON

I am building a web service that serves geographic boundary data in JSON format. The geographic data is stored in an SQL Server 2008 R2 database using the geography type in a table. I use [ColumnName].ToString() method to return the polygon data as…
James
  • 917
  • 3
  • 9
  • 25
10
votes
1 answer

How to convert complex geo-json to wkt in c#?

There is complex GeometryCollection in geo-json format. It contains points and polygons. Is there any well known .net library that can help convert it to Wkt…
user1887099
  • 103
  • 1
  • 4
8
votes
2 answers

How to handle Circle in WKT?

I am having a json object as area : CIRCLE (28.625360369528934 77.2227479486792, 3135.6) how to parse it using WKTreader?
codepeaker
  • 420
  • 8
  • 15
7
votes
1 answer

convert WKT polys in MySQL to Google Maps polys

I have a column of WKT POLYGON values in MySQL (I inherited the db). The polys are queried and rendered on Google Maps. Since Google Maps polygon overlay requires an array of points, the previous user converted the WKT values to coordinate pairs and…
punkish
  • 13,598
  • 26
  • 66
  • 101
7
votes
2 answers

Getting geojson linestring from MySQL geometry WKT data

I'm trying to get GeoJSON linestring format using awesome PHP-Database-GeoJSON library from here https://github.com/bmcbride/PHP-Database-GeoJSON but for now without any luck I was successful with calling simple points from MySQL table using that…
Svinjica
  • 2,389
  • 2
  • 37
  • 66
7
votes
1 answer

Render as GeoJSON (or selectively as WKT/WKB) using MIME-Types

I have Rails with PostGIS, activerecord-postgis-adapter and rgeo-geojson running. At the moment I can use default "object.json" URLs to get a JSON string with WKT/WKB format. It looks like this: {"description":null,"id":1,"position":"POINT (10.0…
Benjamin M
  • 23,599
  • 32
  • 121
  • 201
6
votes
3 answers

How to export WKT from a Shapefile in c#?

I have a Shapefile that contains several thousand polygons. I need to read from this file in C# and output a list of WKT formatted strings. I looked at DotSpatial and the "CatFood" ESRI Shapefile Reader. I can get either to load the shapefile just…
Matt Johnson-Pint
  • 230,703
  • 74
  • 448
  • 575
5
votes
1 answer

Obtaining the center of a WKT polygon

I'm using pandas, and a dataset I obtained has a location column in a WKT format. For example: hospital.get_value(1,'WKT') POLYGON ((-58.4932 -34.5810,-58.4925 -34.5815,-58.4924 -34.5817)) There's a lot more points and with bigger precision in this…
martincito
  • 71
  • 1
  • 5
5
votes
1 answer

Regex for well-known text

I am looking at regexes to validate and parse well-known text, which is a format used to transfer spatial data and looks like: POLYGON((51.124 -3.973, 51.1 -3.012, ....)) or MULTIPOLYGON(((POLYGON((51.124 -3.973, 51.1 -3.012, ....)),POLYGON((50.14…
John Powell
  • 12,253
  • 6
  • 59
  • 67
5
votes
1 answer

shapely.geos.ReadingError: Could not create geometry because of errors while reading input

I'm getting the error in the title when I try to use shapely.wkt.loads on the following input: POLYGON((-93.577695846689437 40.813390731817726,-93.577674865779628 40.813444137603014,-93.577722549304582 40.8136196133706,-93.577945709640048…
user2497586
5
votes
4 answers

Where is MySQL's the POINT() function documented?

It seems like besides using WKT and the GeomFromText function, MySQL support an other method of creating geometries. The function POINT() is used in the examples in the documentation, but I can not find where the function itself is documented. This…
vbence
  • 20,084
  • 9
  • 69
  • 118
4
votes
2 answers

get Well Known Text from lat long

I can get easily a lat,long pair from the Google Maps API: from googlemaps import GoogleMaps gmaps = GoogleMaps(GOOGLEMAPS_API_KEY) gmaps.address_to_latlng('Jose Javier Diaz 440 Cordoba Argentina') >>>> (-31.4464489, -64.191219899999993) And I have…
tutuca
  • 3,444
  • 6
  • 32
  • 54
4
votes
1 answer

Check well-formed and/or valid geometries in mysql

Migrating a MariaDB table with geometric data to MySql, some data cannot be inserted, because they are not well-formed, even if it's not a issue for MariaDB. This request works on MariaDB (10.2). CREATE TABLE IF NOT EXISTS geo ( id INT…
Daniel-KM
  • 174
  • 1
  • 1
  • 13
1
2 3
12 13