Tag Info

Hot answers tagged

5

You can use ST_Difference to create the holes. It will subtract the lakes from your countries. Let's say your lakes are in another table called lakes and you've already stored your countries. You would do something like UPDATE countries SET geom = ST_Difference(geom, (SELECT ST_Union(l.geom) FROM lakes As l WHERE ST_Intersects(l.geom, ...


4

The solution that comes to mind is to use a join between your shapefile and the textfile. Its described on this tutorial. If the attributes values change often, you could use a database backend for your data. QGIS works especially well with PostgreSQL-Postgis databases.


3

POLYGON((-90.89 46.67,-90.89 46.67,-90.89 46.67,-90.89 46.67,-90.89 46.67)) Looks like WKT. If it is, you can convert features/layers/geojson to WKT using Wellknown or Wicket-Leaflet


3

There is no real difference other than the class of the returned object. The raster intersect function is a helper function that, for polygons, calls gIntersection from rgeos (not rgdal). I would recommend using raster's intersect functions because it will save you some steps in getting back to a SpatialPolygonsDataFrame object. One good way to explore these ...


2

try to add this text-dy: -10; you can look at file admin.mss in openstreetmap-carto project dir and find code #nature-reserve-text[zoom >= 13][way_pixels > 192000] { text-name: "[name]"; text-face-name: @book-fonts; text-fill: green; text-halo-radius: 1.0; text-halo-fill: rgba(255,255,255,0.6); text-placement: line; text-dy: -10; } ...


2

It's not an elegant solution, but you could try to convert Polygon string representation into WKT and use ST_GeomFromText select ST_GeomFromText( 'POLYGON ' || regexp_replace( '((-74.026142,40.636264),(-74.026142,40.636438),(-74.025818,40.636438),(-74.025818,40.636264),(-74.026142,40.636264))', '\,(?=[0-9])', ' ', 'g') )


2

The index in native PostgreSQL is basically the same as that in PostGIS (except for selectivity estimates, where PostGIS is better) so there will be no real performance change on such a simple query. Because you're testing one point/poly combination at a time and not doing any repeats of the same poly in the same query (as would be the case on a spatial ...


2

There is no need to use ArcPy for this. You can use the Field Calculator with its Python parser and if/elif(x4) to return values of 1 to 5 to a field, perhaps called GROUP. You can then Dissolve on GROUP to get the five features that you desire.


2

My solution is a GRASS GIS v.select iteration. So I get full line-shapes for each polygon, without getting self-intersection problems.


2

one way is to Export your feature class to another feature class using let's say, Feature Class to Feature Class tool and then in the Environment Settings, set the "output has z values" to Disabled. Then re-run feature class to feature class and set the "Output has Z Values" to Enabled.


2

You need to create a new field in the attribute table of the polygon. When you right-click on this new field, you will have the option to Calculate Geometry. Set the units appropriately and you're on your way.


2

Attach script import arcpy, traceback, os, sys, math from math import radians,sin,cos from arcpy import env env.overwriteOutput = True inFC=arcpy.GetParameterAsText(0) outFolder=arcpy.GetParameterAsText(1) rectangle=r'in_memory\rectangle' tempf=r'd:\scratch\many.shp' def showPyMessage(): arcpy.AddMessage(str(time.ctime()) + " - " + message) def ...


2

OK the syntax is incorrect, the example code using fields from my dataset will help you set up the correct VB script structure. if [NAID] = 23 or [NAID] = 38 then x = 5 elseif [NAID] = 34 or [NAID]= 35 then x = 3 else x = 1 end if You run this field calculate on a field (in my example its a numeric field called q), and you put x into the bottom box as ...


2

ST_Intersection(geomA, geomB) returns a geometry, then calculate areas with ST_Area.


1

This how I would do it: Create your two points Cast polygon into ICurve Use the ICurve.QueryPointAndDistance Method and get the DistanceAlongCurve value for each point Use ICurve.GetSubcurve Method to extract the red curve you have identified in your image.


1

If you export the polygon shapefile to a Feature Class inside a File GDB, the "SHAPE_LENGTH" field should contain the perimeter based on the native unit of your coordinate system (e.g. meters for NAD 83, a useless Decimal Degree length for WGS 84, etc.). @Chris's method above works too. You can also manually measure the perimeter of the polygon using ...


1

It sounds like you may have a problem with a coordinate system. Instead of moving the polygons manually (as it seem like you are trying to do and Sharm's answer reflects), you should try to correct the coordinate system issue and then the polygons will all appear in the correct location. This article will give you some direction about how to check the ...


1

Generally speaking, you need to find the distance from shape centroid to the most distant point on its boundary. That should be the radius of the circumscribed circle. It's rather easy to achieve with PostGIS, not sure about QGIS.


1

If anything becomes tedious and repetitive then it's time to get smarter with your processing. You can automate all that you described by using modelbuilder. You drag the tools you used in to modelbuilder, connect them together to create a work flow and then run the model. You'll invest a bit of time creating the model but then you can tweak a parameter and ...


1

Alexgleith's answer seems to be directly related to the example in the question. However, there are other approaches that are also available and can be done in an offline environment. If you have access to ArcGIS with 3D Analyst Extension then you can simply extrude your polygons by an appropriate attribute. However, 3D Analysts is expensive. A free ...


1

You want to do it yourself? Here's an example: http://agl.pw/examples/cesium/hobart.html It's pretty easy to do. Let me know if you need to know more and I'll try to step through it.


1

Dissolve the canopy layer into a single feature. Use a spatial union to separate the areas of tracts that are canopy covered and are not. Copy and paste the entire attribute table into excel if you have it, and use pivot tables from there.


1

Just in case anyone has come here for a problem like this one here are a few notes: • epsg: 3577 (as Steven Kay used) is the correct spatial reference in this case (Australia) because it preserves area. Spatial references that don’t exactly preserve area (like epsg:4283) will return a slightly wrong area. Everything will need to be re-projected to the ...


1

from my understanding of your question, and looking at the data, you want to assign a population to each polygon. In pseudocode, something like for each polygon popn <- 0 for each intersection(polygon,pixel outline) fraction <- calculate area of intersection (as percentage of pixel outline value) popn <- popn + ...


1

The "LAStools" toolboxes in ArcGIS, QGIS, and ERDAS IMAGINE all operate on one LAS / LAZ file at a time. The "LAStools Production" toolboxes in ArcGIS and QGIS take folders and wildcards instead of filenames as input and can then be run across hundreds of tiles and on multiple cores. For faster performance it is instrumental that you first run lasindex to ...


1

In addition to the roundness formula outlined by radouxju in his response and others like the ratio of the area of the polygon to the area of its minimum bounding circle - ST_Area(geom)/(ST_Area(ST_MinimumBoundingCircle(geom)) as rnd_check in PostGIS: I find it often helps to check the number of vertices/points in a 'suspicious' geometry - ST_NPoints(geom) ...


1

If polygons in the feature class contain other polygons in the same feature class (ex. Lesotho inside of South Africa) and if you need to eliminate manual editing in favor of ModelBuilder, etc., using "Eliminate Polygon Part" is the quickest solution. Tool settings: -"Condition (optional)" = AREA -"Area (optional)" = a very large number (say, 1e+100) ...



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