New answers tagged

6

Go to Layer -> Add Layer -> Add Delimited Text Layer. You should be able to find the csv file you have, give it a layer name, and choose file format as CSV. In the Geometry Definition, you will have to use Well known Text (WKT) by ticking that box. Set the Geometry field to the column you want, and you might want to set the Geometry type as Polygon. See ...


3

Pyshp does not have a WKT method but it does support the geo_interface protocol at the shape level. That protocol returns each shape as geojson. You can then use the lightweight, pure-python pygeoif module to convert to WKT. The pygeoif module is available on the Python Package Index and Github: https://pypi.python.org/pypi/pygeoif/ https://github.com/...


1

Try defining your style like this: var myStyle = new ol.style.Style({ fill: new ol.style.Fill({ color: 'rgba(255, 100, 100, 0.3)' }), stroke: new ol.style.Stroke({ color: 'rgba(255, 80, 80, 0.9)' , width: 2 }), });


1

First, when you load the data using shp2gpsql-gui, ensure that you've set the SRID on the data correctly: you have determined your data are EPSG:3763, so use that number in the SRID field of the GUI. Now that your data is correctly loaded, you can get back geographic coordinate by using the ST_Transform function to convert them from their local system into ...


0

You can convert it to shapefile using delimited text layer plugin in qgis. Change the geometry fields to POLYGON((x1 y1, x2 y2, x3 y3))format and then convert .csv to .shp format.


0

It seems that a "geometry repair" feature is completely missed from Open Source while is a full prerogative of enterprise solution. I use the FME GeometryValidator, even if this require to the geometry to be passed some times to the validator. Grass have a v_clean function that works aligned to the topology, if I'm not wrong. PostGIS have the ...


0

Here's an example of intersecting a geometry point with a WKT polygon: declare @tempPoly geometry; set @tempPoly = geometry::STGeomFromText('POLYGON ((3168400.501482 1706746.617880,3131160.918149 1690210.159546,3164754.668149 1673022.659546,3174650.501482 1688517.451213,3173869.251482 1700366.409546,3168400.501482 1706746.617880))', 2877); select * from ...


2

Simple typo. s.addFeatures(f); Should be s.addFeatures([f]); As you only created a single feature.


2

In Python also With Shapely (port of the GEOS library) from shapely.wkt import loads poly1 = loads("MULTIPOINT ((10 40), (40 30), (20 20), (30 10))") poly2 = loads("MULTIPOINT (10 40, 40 30, 20 20, 30 10)") print poly1 MULTIPOINT ((10 40), (40 30), (20 20), (30 10)) print poly2 MULTIPOINT (10 40, 40 30, 20 20, 30 10) # convert to GeoJson mapping(poly1) {'...


3

WKT is defined in the document "OpenGIS® Implementation Standard for Geographic information - Simple feature access - Part 1: Common architecture" http://portal.opengeospatial.org/files/?artifact_id=25355. In the standard MultiPoint WKT is defined as <multipoint text> ::= <empty set> | <left paren> <point text> {<comma> <...


2

readWKT from the rgeos package in R reads them both as valid and identical: > readWKT("MULTIPOINT (10 40, 40 30, 20 20, 30 10)") SpatialPoints: x y 1 10 40 1 40 30 1 20 20 1 30 10 Coordinate Reference System (CRS) arguments: NA > readWKT("MULTIPOINT ((10 40), (40 30), (20 20), (30 10))") SpatialPoints: x y 1 10 40 1 40 30 1 20 20 1 30 10 ...


1

WKT is only a text markup language for representing vector geometry, therefore you cannot convert 3D WKT to 2D (= text to text), you need to change the geometry The problem with ogr is that it seems that all the geometries are 3D by defaut 1) Creation of a 2D point with ogr point = ogr.Geometry(ogr.wkbPoint) # 2D point point.AddPoint(1198054.34, 648493.09)...



Top 50 recent answers are included