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
4
votes
2 answers

set precision in writeWKT from rgeos package

I am creating a WRT string from a specialPolygons object in R. However I am surprised by the number of digits in the output. Is there a way to reduce it? x = sp::SpatialPolygons(Srl = list(sp::Polygons(srl = list(sp::Polygon(coords = cbind(c(-19.8,…
RockScience
  • 17,932
  • 26
  • 89
  • 125
4
votes
2 answers

How to convert wkt to jts geometry for a geography?

I want to convert a wkt geography into a jts geometry. I tried using jts wkt reader like this. import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.io.WKTReader; Geometry geometry = wktReader.read(wktString); Here the problem…
geek2coder
  • 41
  • 1
  • 4
4
votes
1 answer

WKT and openlayers

I cant find out how to use the WKT format in OpenLayers. I have tried finding the solution in the documentation, witch bascily brought me to this: http://jsfiddle.net/Christer/WG8YP/2/ But that gives me the error of : Uncaught SyntaxError:…
Christer
  • 1,651
  • 1
  • 17
  • 34
3
votes
0 answers

Open layers on remote geodatabase with st_read() and a wkt_filter

In R, using sf, I'm trying to open some layers in the National Hydrography Dataset cropped to my area using st_read with a wkt_filter. I always get an empty sf object; has all the column names and crs but no rows. I've made the wkt_filter much…
Jim Worrall
  • 466
  • 3
  • 11
3
votes
2 answers

(lat, lon) WKT coordinates do not reproject well with st_transform

I am having some issues importing a file with wkt multipoint features with SRID 4326, for which the coordinates are in order (lat, lon): >st_crs(4326) Coordinate Reference System: User input: EPSG:4326 wkt: GEOGCRS["WGS 84", DATUM["World…
3
votes
0 answers

How to simplify a MULTISURFACE, CURVEPOLYGON, or COMPOUNDCURVE geometry?

I just downloaded spatial information from the National Wetlands Inventory (NWI). I'm trying to manipulate the geometries in R (st_transform, st_cast, st_crop, etc.), but I've never seen a geometry this…
cbowers
  • 137
  • 8
3
votes
0 answers

Determine whether a string is a WKT

I have a csv of values, and I need to determine if a string-field is a well-known-text geometry representation. For example, if I have the following data: name,info "tom","POINT (30 10)" "brad","linestring (30 10, 10 30, 40 40)" That would I would…
David542
  • 104,438
  • 178
  • 489
  • 842
3
votes
1 answer

Implicitly convert Geometry to WKT string in PostGIS

Suppose I have a table defined as follows: CREATE TABLE gtest (name varchar, geom geometry); To insert, I am able to simply do this: INSERT INTO gtest VALUES ( 'Polygon', 'SRID=4326;POLYGON((0 0,1 0,1 1,0 1,0 0))' ); I don't have to wrap…
robbieperry22
  • 1,753
  • 1
  • 18
  • 49
3
votes
1 answer

Does PostGIS automatically convert upon inserting WKT?

I'm quite new to PostGIS so bear with me. Suppose I have a table defined as follows: CREATE TABLE gtest (name varchar, geom geometry); At first, to insert, I was doing something like: INSERT INTO gtest VALUES ( 'Polygon', …
robbieperry22
  • 1,753
  • 1
  • 18
  • 49
3
votes
1 answer

Getting wrong spatial result in SQL server + management studio (2014) when parse from MultiPolygon WKT

SQL query for parsing WKT to DbGeography: select geography::STMPolyFromText('MULTIPOLYGON (((-2.5591667 49.2208332, -2.4799491 49.2644641, -2.3891134 49.2959748, -2.2950459 49.325767, -2.2176605 49.3624676, -2.1335686 49.4074579, -2.0975001 49.4605,…
SadikAli
  • 594
  • 1
  • 4
  • 21
3
votes
1 answer

Difference between WKT and GeoJson (data parsing)

I need to write a parser in C++ which allows me to create a geojson geometry type from a valid WKT string. So, I have a valid WKT string as input, and I need to convert it and write all coordinates etc. using rapidjson. The thing I wonder about is…
benjist
  • 2,740
  • 3
  • 31
  • 58
3
votes
3 answers

GeoAlchemy2: Get the lat, lon of a point

Consider the following SQLAalchemy / GeoAlchemy2 ORM with a geometry field: from geoalchemy2 import Geometry, WKTElement class Item(Base): __tablename__ = 'item' id = Column(Integer, primary_key=True) ... geom =…
Adam Matan
  • 128,757
  • 147
  • 397
  • 562
3
votes
1 answer

Converting a CSV with a WKT column to a Shapefile

Using ogr2ogr in Python, I am trying to convert a CSV to a shapefile. One column in the CSV, named "Polygon", contains WKT like this: POLYGON((long lat, long lat, long lat, etc.)) Currently, I can make a polygon shapefile with the correct…
Daniel W
  • 31
  • 1
  • 2
3
votes
1 answer

How to get WKT area?

i use jts.jar, package is com.vividsolutions.jts.geom, to get a geometry's area. but the method getArea() does not give me the right result. my code is public static void main(String[] args) throws ParseException { GeometryFactory…
3
votes
1 answer

Validation of a geometry in WKT format

I am new to GIS area and I need to validate a geometry in WKT format in java, to check whether a simple polygon is a closed loop, i.e the start and end points of the vertices should be the same. I am currently using jGeometry class of oracle…
kumar
  • 565
  • 1
  • 5
  • 11
1
2
3
12 13