Tag Info

New answers tagged

0

Use ST_Intersection So something like: SELECT ST_Intersection(p1.the_geom, p2.the_geom) As the_geom FROM p1 INNER JOIN p2 ON (ST_Intersects(p1.geom, p2.geom) ); If you know the ids or some other delimiting factor you could do this: SELECT ST_Intersection(p1.the_geom, p2.the_geom) As the_geom FROM p1 CROSS JOIN p2 WHERE p1.cartodb_id = 1 and ...


0

I solved the problem, by getting the polygons exterior ring, IRing interface has the method GetSubcurveEx, this method is perfect for my case since I can specify which direction I want the subcurve to follow. I can specify clockwise or counter clockwise, so I got both directions and simply picked the shortest. Here is how I done it. ...


2

You can use grass, tool named v.clean. There, you set rmarea. The threshold parameter will be in unit of theme. All feature which have area less than treshold will be deleted.


2

Converting a polygon into a perfect rectangle means the same than closing it inside a minimum bounding rectangle (MBR). There are two sorts of MBRs: an oriented rectangle which has its axes in the same direction as the coordinate system, or truly minimum rectangle which can be rotated. The oriented one is also called as Envelope. Let's begin with two ...


1

Attach this script: # Import arcpy module import arcpy, traceback, os, sys from arcpy import env env.overwriteOutput = True try: # input folder with shapefiles or rasters inputFolder = arcpy.GetParameterAsText(0) env.workspace = inputFolder # output folder for tiles shapefile outputFolder = arcpy.GetParameterAsText(1) # table name ...


4

Note that both methods below will export non smoothed polygons boundaries. You may have to resample your DEM file to get smoother lines or use further smoothing techniques. Step 1: Spatial Analyst (Classification) You could use Spatial Analyst to classify your data in 2 classes: 1 = data within the boundary values (example : elevation < X meter) 0 = ...


0

f I understand correctly you only want to create polygon boundary that surrounds elevations that are below a certain value... Assuming you also have 3D analyst/ Spatial Analyst extensions, there are probably several different ways to do this. Here is the Cut/Fill Tool technique but it involves several steps: I (The Cut Fill tool but this requires raster ...


0

I think the fishnet tool is the best solution. The polygon to be split can be given as template. This will ensure that the resultant grid is within the required polygon boundary. any suggestions ---


0

The schema of your layer expects a gml:MultiSurfacePropertyType for the_geom field but you are filling the field with a Polygon. Check this thread. I'm not sure if sending a MultiPolygon automatically converts to MultiSurface. Try something like newFeature = new ol.Feature({ the_geom: OpenLayers.Geometry.MultiPolygon([geometry]) });


0

For the US and Canada you can download Neighborhood data (shapefile format) here: US: http://dinehere.us/neighborhoods.html CA: http://foodpages.ca/neighborhoods.html


1

You can geocode a list of zipcodes that you can upload as a regular dataset, but probably it's better for you to find them directly from their source and upload that dataset. If you're looking for USA zipcodes, I recommend you to take a look at the ZCTA datasets that Census US offers. This dataset is the lighter one I found for these regions: ...


3

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


0

QGis should be able to import this directly as an XYZ grid (under Raster) provided it meets the following (from the GDAL Manual): Those datasets are ASCII files with (at least) 3 columns, each line containing the X and Y coordinates of the center of the cell and the value of the cell. The spacing between each cell must be constant and no missing value is ...


2

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.


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 ...


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


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

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 ...


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.


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 ...


0

From the looks of it these two links should help you out. http://pro.arcgis.com/en/pro-app/help/editing/select-features-for-editing.htm http://pro.arcgis.com/en/pro-app/help/editing/move-or-rotate-or-scale-a-feature.htm Basically you have to be in editing mode to make the changes and then save the changes from there.


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 ...


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.


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 ...


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.


0

The tool which should help you to accomplish this is Polygon Neighbors (Analysis): Creates a table with statistics based on polygon contiguity (overlaps, coincident edges, or nodes). Once you know a polygon's neighbors you can work on whether adding attribute values from one or more of them to those of the original polygon will meet your criteria. ...


0

Seems to me that you need to clip your road feature first using your polygons. Then begin the point selection process. Other thing to consider is how the road feature is drawn. Is it a polyline? Is a single feature? If you're trying to get only 1 point that is closest then you need to make sure the individual roads are 1 feature too. This would be so much ...


0

the pixels that fall within the polygon, and get the sum of the pixel value CREATE TABLE gtur_srtm_inter AS SELECT id, (gv).geom AS the_geom, (gv).val FROM (SELECT id, ST_Intersection(rast, the_geom) AS gv FROM srtm_tiled, gtru_poly_vect WHERE ST_Intersects(rast, the_geom) ) foo; The values ...


0

With the commercial software Mapviewer from Goldensoftwar http://www.goldensoftware.com/products/mapviewer producing this "Prism-Maps" is pretty easy:


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 ...


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.


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.


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 ...


0

You can use ST_ConcaveHull to get approximate polygon. Since the lines don't actually form the boundary of the areas you're going to have some difficulty getting a perfect coverage of polygons from the data. Another possibility is building a line voronoi using the faces and assign faces to categories based on what lines fall within the faces. I don't know ...


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

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

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


0

Solution from LR1234567 works OK, but I didnt want to create second table. At the end, I have create multipolygon with holes directly during geometry construction, using WKT. MULTIPOLYGON ( ( (40 40, 20 45, 45 30, 40 40) ), ( (20 35, 10 30, 10 10, 30 5, 45 20, 20 35),(30 20, 20 15, 20 25, 30 20) ) ) See Wiki


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, ...


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.


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 ...


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



Top 50 recent answers are included