Tag Info

New answers tagged

0

So I haven't completed the solution, yet, but it looks like you can use this tool: Conversion > JSON > Features to JSON. This will convert your shapefile (in my case 81 polygons) to a JSON file. You can open this with a text editor to see that, indeed, all the vertices are listed for each polygon. Further, the python standard library (import json) ...


1

Update. I took a closer look at my problem lake outline, and found that there were two points crossed over, effectively creating a very small loop on my geometry (QGIS highlighted this with a green cross when I zoomed in). I rearranged the two points and retried the cut using the same process and all polygons now cut correctly.


5

You can accomplish this with the Select Layer By Location (Data Management) tool. Make sure to select the "HAVE_THEIR_CENTER_IN" option in the Relationships parameter. To make the selection permanent, use Copy Features (Data Management).


0

It doesn't want you to use unprojected data because polygons are not properly represented unless you use an equal area projection. Take a look at Greenland vs Africa on a GCS map and it tells you Greenland is bigger than Africa - not even close. So, in order to get proper measurements ensure you apply an equal area projection to your data that suits the ...


0

An another solution for a basic use (just merge all polygons): Select ST_Union(the_geom_webmercator) as the_geom_webmercator FROM Tablename group by cartodb_id


2

I replicated the results you are looking for using the “feature vertices to points” tool and an available buildings layer on hand. Steps 1-5 is because I prefer working from a geodatabase. Can you open ArcCatalog to your working folder and preform the following steps? 1) Open ArcCatalog and navigate to your working folder. 2) Right click and selecting ...


2

You can do this with the Python script provided by Esri in the "Reading Feature Geometry" section of ArcGIS Online Help. http://resources.arcgis.com/en/help/main/10.1/index.html#//002z0000001t000000 Here is the script provided in the said reference: import arcpy infc = arcpy.GetParameterAsText(0) # Enter for loop for each feature # for row in ...


0

If you load your data into qgis you can prepare your data to creating kmls. I'm not sure what attributes are in your dataset, and how are they separated, but maybe after to load them into qgis you need to do some additional steps, like merge, or calculation fields and then you can export your dataset separated by materials and their depth plus the surface ...


0

If these are gdb feature classes, another option would be to use a Definition Query that is based on the SHAPE_AREA field. Just right-click on the layer in the TOC and copy and paste it. Place the new layer on top of the old layer, and in the new layer add a definition query that will filter out any features that are bigger than ____. Now you have the ...


3

Since you already have a field carrying the area, just use the Sort tool, and use the area field with the 'DESCENDING' option. Note: The Sort tool requires an advanced license.


7

You could add a new field called Size, and then field calc either Small or Large into the new field. Then symbolize by Unique Values based on the Size field. Then go into Advanced --> Symbol Levels and make sure the Draw this layer using symbol levels specified below is checked, and that the Small label is above the Large label. However you choose to do ...


1

This is also called "binning", which when applied to hexagon polygons, is referred to as "hexagonal binning" or simply "hex binning". There is a top-notch blog article (Binning in GIS) at GIS Lounge on the subject, which points to an Esri blog that explains how to create the maps in ArcGIS Using a binning technique for point-based multiscale web maps ...


4

(1) I have usually heard of it referred to as a "Hexagonal Map" or "Hexagonal Grid Map". Both queries turn up a lot of relevant results in Google. Example Link Here: http://anitagraser.com/2012/03/04/mapping-density-with-hexagonal-grids/ The link above also outlines the process that you would use in QGIS. If you want to do it in ArcGIS. This article ...


0

You can do that with Vector -> Geoprocessing Tools -> Difference of the Menu Mar. Two arbitrary shapefiles overlapped near of Europe area: Difference Tool Window where the input vector layer is big_polygon and the difference layer is small_polygon. The resulting difference polygon:


3

Your first step is, as you've already deduced, Generate Near Table. It is important to unselect closest only or specify closest="ALL" if using a script. Your in features will be your distrcits, to features will be the storm paths. This will give you a table with too much information and needs to be refined and summarized. IMPORTANT Before running Generate ...


0

The country boundaries including the territorial waters are available in the OSM data set. I found a site wher these country shapes can be downloaded https://osm.wno-edv-service.de/boundaries/


0

I've tested this on both my laptop (OS X) and my desktop (Ubuntu) but not a Windows box. As @til_b says, the problem seems to be that the .dbf has a different name to the .shp and .shx files. After renaming the file behaved much better. I also suggest you dissolve the layer using Vector > Geoprocessing Tools > Dissolve toolset. After dissolving I was ...


1

The tool "Symmetrical Difference" can also do this: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00080000000r000000 This tool is available in QGIS, a free GIS you can download here: http://www.qgis.org/en/site/forusers/download.html


1

The exact tool you are looking for is called "Erase". Unfortunately, it is only included in the Advanced/ArcInfo license level. You might be out of luck unless you can write your own version of this tool. ArcGIS Erase


0

Quick overview on outer ring directions of polygons in various formats by their specifications: ESRI Shapefiles/ SHP: clockwise WKT: counter-clockwise KML: counter-clockwise GeoJSON: undefined TopoJSON: forces clockwise by default Under the assumption, that, in the general case the smaller area describes the enclosed area of the polygon leads to the ...


2

With your VRT file GDAL tries to find layers "temperature" and "elevation" from the target databases. Either use the original layer names in VRT in OGRVRTLayer name: "rice_temp" and "rice_elev", of rename them with SrcLayer <OGRVRTDataSource> <OGRVRTLayer name="temperature"> <SrcDataSource>rice_temperature.sqlite</SrcDataSource> ...


0

At the end I did not have to use the QGIS Modeler, even if probably its implementation would be more efficient of my solution. I have used "Eliminate Sliver Polygon" from the "Processing Toolbox" as a "Batch Process". I have selected all my shape files, then manually filled in: Selection Attribute: name of the field in my table, in uppercase, no quotes; ...


2

The following is a very close approximation to the right answer which works under the assumption that the vertices of the polygon and the point in question all lie within roughly 2000 km of each other: Download and install the my C++ library GeographicLib. Using the test point as the center of projection, use the Gnomonic class to transform the vertices of ...


-1

The Qgis Modeler isn't near as good as the ArcGis equivalent. If you want to stay with Qgis // opensource. You should really start using python//pyqgis Follow this link to Pyqgis And in your case it isn't that complicated : a loop over all your layers, an applying 2 operations is all you need. Here is a hint : To get hold of all your layers : ...


5

Yesterday I had no time to create it in details... See my solution in 4 steps: CREATE OR REPLACE VIEW bd_segment AS SELECT ST_PointN(geom, generate_series(1, ST_NPoints(geom)-1)) AS sp, ST_PointN(geom, generate_series(2, ST_NPoints(geom) )) AS ep FROM -- extract the individual linestrings (SELECT ...


3

I would do this the other way around from current comments/answer. I am assuming your scenario changes are where the flood values, not the buildings, change. Convert your buildings to raster with Polygon to Raster, using your flood raster as the extents and matching cell size/row column count/etc. There is some risk that a resulting cell won't be classed as ...


3

This is probably a bit of a roundabout way of performing this analysis, but I just did a quick test and it worked for me: Use the Raster to Polygon tool convert your raster, with the simplify polygons option unchecked. This should provide a polygon representation of the raster cells with the 'gridcode' attribute being the value of the raster cells. ...


-1

In python, there's a library called shapely...one call will do it once you've constructed your polygon and point: point.within(polygon) See: http://stackoverflow.com/questions/217578/point-in-polygon-aka-hit-test/2922778#2922778 this was the result of a google search "c++ polygon point within"


0

First of all, clarification is in order for ZIP codes. They are NOT boundaries or polygons. ZIP codes are service routes that are correctly represented as points or as sides of a street in a GIS context. If you are interested in using Mappperz links, I would supplement his recommendations with a page that talks about what ZCTAs are and how they are created ...


0

Yes! This is a free service, returns geojson from zipcodes: https://www.mashape.com/vanitysoft/boundaries-io you can include multiple zipcodes,cities,states.


4

You can use Zonal Statistics as Table (Spatial Analyst) for this type of operation. The tool accepts both vector and raster data as input. You can join the results to your input feature class if you wish.


2

If you want to do it based on a field, you can do this in QGIS from the menu: Vector-->Geometry Tools-->Singleparts to Multipart (requires at least two poylgons to share an attribute that you specify). There is a more direct equivalent to ST_Multi in OGR. I didn't find a way to access this specific OGR functionality through QGIS, but that could be done ...


1

Here's my solution. I used the Raster Calculator to determine where my raster is greater than X, outputting a layer that is 1 (greater than X) or 0 (less than or equal to X). I then used the Zonal Statistics plugin to calculate the mean value of this new layer within each polygon. This gives the proportion of the polygon where the raster is greater than X. ...


0

This might not be the most Pythonic solution but it works. The resulting string complies with http://geojsonlint.com/. def geojsonArea(self): coords = [] for c in self.coordinates: p = {'lat': c.lat, 'lng': c.lon} coords.append(p) geojson_obj = { "type": "FeatureCollection", "area_name" :self.name, ...


0

This might be adaptable for your needs. If you don't mind calling the command line from python, you could do something like gdalwarp -cutline clip.shp -cl clip -crop_to_cutline input_raster output_raster_clipped.tif. -cwhere and -csql might be more appropriate gdalwarp options for selecting one of the four polygons for clipping.


6

The Geometry.within() method only accepts other Geometry objects -- in your case, it has to be a Polygon. It doesn't know what to do with a feature class, so I would suggest dissolving that feature class into one containing a single polygon, and then access the Geometry object with this: urban_area_geom = [r[0] for r in ...


1

If you have a unique identifier field for both the the csv and existing layer. Try join attributes.


1

if you are getting it to draw from the csv file just select it, copy it and then paste it into the 1st file. Otherwise if you have many of these to to set up a postgresql/postGIS DB table to handle the data and load the csv file to the table in the db through a psql COPY cmd.


1

As per my comment in that question, it's to do with the spTransform. Simply remove the offending line: world <- spTransform(world, CRS("+proj=robin"))


4

I think this is a great question and one with more relevance as we start using different technologies to store spatial data such as PostGIS. There are two issues involved here, from what I can think about: 1) Scale: I used to teach cartography students that a City from the view of "The Country" is a point, but as you zoom in to the scale of a "region", ...


4

We rarely used the Toolbox within ArcGIS 10.x. The problem was with several bugs in the Toolbox's Python script. We have fixed the problems and now it works with ArcGIS 10.x. If you need the fixed toolbox, do not hesitate to contact me and I will send it. (I am one of the authors.)


0

regarding this issue I found that fields does not appears in the drop-down menu when the field "type" is float. It varies according to the software used, but copying the values to a text field may usually work. Hope this helps to somebody else.


0

If Java works for you, take a look into http://github.com/Esri/geometry-api-java. It has OperatorSimplify for polygon repair. It also has OperatorSimplifyOGC if you want the polygons to be also OGC compliant.


0

Building on @Brad Nesom's answer, if you're willing to look at an FME solution, there are some transformers that can help with your problem. But probably the most useful one would be the Geometry Validator. It has many options for identifying and repairing geometry errors. As you can see, the dialog contains many tests including Self-Intersections in 2D: ...


0

So, just to get this clear:) When in doubt if your single polygon feature class contains self-overlapping polygons, and when this constitutes an error in your final product, you could run the intersect tool. I didn't know that the tool itself could handle a single input, but it turned out that it works in precisely the same way which it would have done when ...


4

ST_Polygonize will do the job: CREATE VIEW boundarypolygons AS SELECT g.path[1] as gid, g.geom::geometry(polygon, 31492) as geom FROM (SELECT (ST_Dump(ST_Polygonize(geom))).* FROM boundary ) as g;


1

Since you are using PostGIS and QGIS, you can try to convert them using both, to decide which one is best suited for your problem. To use PostGIS, the LINESTRING must be closed. You can check if they are closed with the query: select gid, st_isclosed(geom) from boundary; If the lines are closed, you can create another table to check the results, with: ...


0

Here's a work-around in desperate times: Start editing the feature-class or shapefile Select the polygon feature and right-click to 'Edit Vertices' Right-click on one of the vertices and select 'Sketch Properties' A fly-out will appear with the coordinates of the vertices listed Take a screen-shot of the coordinate list Paste the screen-shot into your ...



Top 50 recent answers are included