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.


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()


4

I would create a middle point layer for snap purpose. Using this nice script of Paul Ramsey and updating for your use case: CREATE TABLE polygons ( gid integer primary key, geom geometry(Polygon, 4326) ); INSERT INTO polygons VALUES (1, 'SRID=4326;POLYGON((0 0,1 0,1 1,0 1,0 0))'); INSERT INTO polygons VALUES (2, 'SRID=4326;POLYGON((10 10,11 10,11 ...


4

This feature is currently being evaluated to be integrated with QGIS 2.16 (and has good chances that it will be) will be part of QGIS with the 2.16 release and present on master builds from after Apr, 29 2016. For a solution compatible with 2.14 see below. Or if you want to use QGIS 2.14, use a Geometry Generator symbol layer. CASE WHEN ...


4

You can do this with 2 tools, Feature to Polygon and Spatial Join First, run your polygons through Feature to Polygon. Delete any of the attributes you don't need from the output (I still got them even when I turned preserve attributes off): Then, run Spatial Join: The target features are the output of Feature to Polygon The join features are your ...


3

Here is a summary of the main differences. Note that both tools can split lines at intersection (it depends on the selected option): Input types: feature to lines: Lines and/or polygons polygon to lines : polygon only Number of input: feature to lines: multiple inputs polygon to lines : one Management of shared boundaries feature to lines: two lines* ...


2

You can change the appearance in JOSM via styles. There are already various different styles available. Alternatively you can create your own style. This affects only the map rendering in JOSM of course.


2

Check ST_Transform from the very helpful PostGIS docs: SELECT ST_AsText(ST_Transform(ST_GeomFromText('POLYGON((-71.1776585052917 42.3902909739571,-71.1776820268866 42.3903701743239, -71.1776063012595 42.3903825660754,-71.1775826583081 42.3903033653531,-71.1776585052917 42.3902909739571))',4326),2249)) As wgs_geom;


2

What version of QGIS, first? I'm using 2.8, and I loaded a layer that has a proper projection/coordinate reference system (CRS). My project is now using that CRS (in my case, MGA Zone 55, 28355). I can tell that by looking in the lower right corner of the QGIS window, or going to project properties. If I choose 'Vector' -> 'Research Tools' -> 'Vector ...


2

Speed up extracting raster (raster stack) from point, XY or Polygon Great answer Luke. You must be a R wizard! Here is a very minor tweak to simplify your code (may improve performance slightly in some cases). You can avoid some operations by using cellFromPolygon (or cellFromXY for points) and then clip and getValues. Extract polygon or points data from ...


2

I'm still confident that the issue is the file path in attribute 'icon' (seeing as this method has worked on a data-set my end). Could you post an example string from this attribute so we can see if it should work? If this is the issue, or if you are having trouble editing this attribute, as you say above, I would recommend re-creating the attribute using ...


2

How many unique values are in your table? I would do an intersect. In your example, the new feature where all 3 overlap would be called green, red, black. Now if you have about a hundred unique values, you're going to have a lot of intersections. You will still be able to see which values are overlaps and which values don't.


2

This lacking feature / bug is known and reported at https://hub.qgis.org/issues/9199 For now, you could create a centroid point layer, remove potential unwanted points and symbolize that.


2

What defines which projection is a polygon based upon, and therefore which projection should apply to it? For these vertices, are the right polygons the left or the right ones? That depends on what purpose the polygons are going to used for. If their areas matter, then you should build them in an equal area projection like Albers. If 90 degree ...


1

Since you cannot really define contingency based on common boundaries (using something like spdep::poly2nb), you could use the polygon centroids to build a k nearest neighbor relationship. This will unfortunately not account for polygon size but is a good place to start. require(spdep) require(rgdal) polys <- readOGR(system.file("etc/shapes/", ...


1

Polygon To Line is a tool that convert polygon feature to line feature. It is stated clearly in Polygon To Line help that it Creates a feature class containing lines that are converted from polygon boundaries with or without considering neighboring polygons. Whereas Feature to Line not only converting polygons to lines, but also splitting line, ...


1

I think what you need to do is to clip raster by the polygon, to do that go to Data management toolbox -> Raster tools -> Raster Processing toolbox -> use the Clip tool found in the Analysis toolbox. You have the ability to use the selected features as the clipping extent. If a feature within the feature class is selected, and confirm that Use Input Features ...


1

If you're using ArcGIS: You can use the Near tool. You can also use the Spatial Join tool and under Match Options, choose Closest.


1

Run the Join Attributes by Location tool on the polygon and point layer (see this tutorial). This will give you an option to get the sum count of points within each polygon. After you have that you may setup your rendering based on the new sum field in the new polygon layer.


1

If you are using Openlayers see here. If you are using leaflet see here. For pure javascript see here or for NPM resources here or here There are other solutions beyond these but this should be enough to be getting on with.


1

The point to line feature in arcgis requires data in a table to be ordered on the id for the group of points, i tried sorting the data but that didn't work still the point to line feature draws extra unnecessary lines but there was less extra liens this time,so my final solution was to use the point2one plugin in QGIS and that worked perfectly no extra ...


1

To properly convert points into lines, you need to have a unique field which has a same value for each group of points so that ArcGIS can recognize that these group of points with a same value represents one line. Without a unique field, the output lines will be mixed lines crossing each other. You refer to the Points To Line help for more information. ...


1

Thankfully it was just a stupid mistake. What happened was I had created a new Map Document to work with this particular polygon feature. When creating this new map document, I forgot to change the Coordinate system to use Feet as the Map Unit of measurement. So, when I was entering my Direction/Length, it was looking for Decimal Degrees and I was feeding ...


1

The WKT you have there is not correct it seems, the syntax is wrong. You have a space-charakter at the wrong place. For example the -1.778877_0,30.39029 has a space, then a zero then the comma for the next coordinate pair. If this is intended and you want to have the Z-Value you need MultipolygonZ (that is not supported). Also its strange to have a ...


1

Thanks for the help. I think I've got it. To help anyone in the future, what I did was to join the database file with my existing shapefile map. Then i saved the Database file as a .csv with xy geometry. I had to edit the .csv file in excel to make sure the Date Format was correct. Then I saved the .csv file as a shapefile in QGIS because Timemanager only ...


1

Ok, this turned out to be as simple as text search and replace: <Polygon><outerBoundaryIs><LinearRing> to <LineString> and </Polygon></outerBoundaryIs></LinearRing> to </LineString>


1

Try the polygonize tool vector instead, it can give good results where the lines to polygons tool fails. You can find it by searching the processing toolbox.


1

If many of your lines generalize to one big square, this most probably means that their topology is not good (line are not exactly touching, therefore the polygon cannot be delineated). You could use the GRASS GIS v.clean command in order to snap the lines that are nearly touching. Make sure that you work on a copy because this modify the whole dataset. ...


1

I would suggest dissolving (Vector > Geoprocessing Tools > Dissolve) your water area shapefile to a single feature (as mentioned by @Matte) before running the Difference tool. You could do this inside QGIS but since it's a large file, I would probably suggest using ogr in the OSGeo4W Shell. Example: ogr2ogr -f "ESRI Shapefile" dissolved.shp input.shp ...


1

I can import the file using the delimited text file import button, simply chose semicolon ; as the delimiter and WKT as the geometry type. This leaves you with the simple task of finding out what the projection of the data is. I tried searching the site but my spanish isn't that good.



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