Hot answers tagged

8

The Topology Checker plugin has an option to check if a layer contains multipart geometries. It is also possible to highlight multipart geometries.


7

Use ST_GeomFromGeoJSON. SELECT ST_GeomFromGeoJSON('{"type":"MultiPolygon","coordinates":[[[[-125045.48351212002,4577567.588141698],[-124816.19981552364,4577552.93014355],[-124765.99472517562,4577419.175847012],[-124842.47121534991,4577392.905406596],[-125045.48351212002,4577567.588141698]]]]}'); Returns: ...


6

Use ST_GeomFromGeoJSON select ST_GeomFromGeoJSON('{"type":"MultiPolygon","coordinates":[[[[-125045.48351212002,4577567.588141698],[-124816.19981552364,4577552.93014355],[-124765.99472517562,4577419.175847012],[-124842.47121534991,4577392.905406596],[-125045.48351212002,4577567.588141698]]]]}') Result: ...


6

My solution involves a PyQGIS script that is faster and more effective than a workflow involving snapping (I gave it a try too). Using my algorithm I've obtained these results: You can run the following code snippets in sequence from within QGIS (in the QGIS Python console). At the end you get a memory layer with the snapped routes loaded into QGIS. ...


5

Your GeoJSON sample lacks information about the coordinate reference system, although you say it is SRID 900913. This is so-called Google Mercator or Web Mercator, which has been superseded by EPSG:3857, which I will use in this example. An important question is whether you really want Well-Known Binary, which does not include an SRID, or Extended Well-Known ...


5

Not tested but perhaps use something like this in the Python Console: layer = qgis.utils.iface.activeLayer() geom = QgsGeometry() if layer.wkbType() == QGis.WKBMultiPolygon: for feature in layer.getFeatures(): if geom.isMultipart(): print feature.id()


5

I did it in ArcGIS, surely can be implemented using QGIS or simply python with package capable of reading geometries. Make sure that roads represent network, i.e. intersect each other at the ends only. You are dealing with OSM, I suppose it is the case. Convert proximity polygons to lines and planarise them, so they become a geometric network as well. ...


4

If you want to transform coordinates to another SRID, you will use ST_Transform: SELECT ST_AsText( ST_Transform('010600002031BF0D0001000000010300000001000000050000008FEF9C07089AFEC0B90A9856E87251410F355DB1B395FEC0DCCEADDCED72514194BE3130A693FEC0DFD23127D072514114797186FA97FEC094E0C313CB7251418FEF9C07089AFEC0B90A9856E8725141' ...


3

As a comment to an answer by @bugmenot a quotation from GML-SF document http://portal.opengeospatial.org/files/?artifact_id=11266, GML is more than simple features. In both GML and previous Simple Features (SF) specifications for OGC, such as Simple Features for SQL (SF-SQL) [10], features are considered to be objects which can have geometry and ...


3

GML is built on the Simple Feature geometry model. The SFM says that a self-intersecting polygon is not "simple" and thus not valid. So I would say no, GML does not allow that.


3

ST_MakeBox2D already returns a geometry that is a polygon for PostGIS. The right syntax has points in lower left-upper right order but function does not seem to be strict with that. SELECT ST_MakeBox2D( ST_GeomFromText('POINT (0 0)'), ST_GeomFromText('POINT (1 1)')); "BOX(0 0,1 1)" SELECT ST_MakeBox2D( ST_GeomFromText('POINT (1 1)'), ...


2

I realize you're asking for a QGIS method, but bear with me for an arcpy answer: roads = 'clipped roads' # roads layer hexgrid = 'normal-hexgrid' # hex grid layer sr = arcpy.Describe('roads').spatialReference # spatial reference outlines = [] # final output lines points = [] # participating grid vertices vert_dict = {} # vertex dictionary hex_dict = {} # ...


2

If you were to split the road line into segments where each segment was completely contained by the hexagon, your decision on which hexagon line segments to use would be whether the distance from the split road segment's centroid to each hexagon side's midpoint was less than half the diameter of the hexagon (or less than the radius of a circle that fits ...


1

You got this error because you are trying to get an Extent of point geometry , so the Point geometry does not have an extent like (polyline,polygone ...) the school feature layer is a esriGeometryPoint Layer , so you cant work with extents here : I used the centerAndZoom map function to zoom to the returned point geometry , and i've add graphic for ...


1

You need to consider to migrate your data to a spatial database, like Postgis. Shapefile is not a supported format for WFS-T. Check here for more information.


1

You can use the ST_AsText function to get the WKT representation of your geometry, this will return the coordinates in whatever projection you have. (You will only get the latitude and longitude if your data is stored in a Geographic Coordinate system, SRID 4326 works for most cases) You can use this query to change SRID ALTER TABLE table     ALTER COLUMN ...


1

vince is right. when you need functionality that was introduced in a specific release of the ArcGIS API for JavaScript (or any API for that matter) the only way to get access to it is to utilize the version where its present. https://developers.arcgis.com/javascript/jshelp/new_v313.html


1

ArcGIS Desktop already has a tool that does this. It's called Feature Compare. You can limit it to only compare the Geometries. You could use the output from this tool to further scrutinize the geometry. For example, if Feature Compare finds geometry differences for features with ObjectID 142 (in both feature classes), you could then pump those features ...


1

Additional to ahmadhanb answer, you can create a buffer of a few degrees/km/miles to the "Polygon from Layer Extent", in this fashion you will have some space out of the most external vertices of your continental shapes (which is what you obtain). Then, you may apply "Difference" to this buffered shape to erase you continent polygons and obtain the ocean.



Only top voted, non community-wiki answers of a minimum length are eligible