Tag Info

Hot answers tagged

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


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


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

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;


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.


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


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


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


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


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


2

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


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


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


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


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


1

OK so I wanted to convert islands to holes and holes into islands but couldn't find a command to do it in QGIS so I wrote a script myself. Here is that "simple" script which will invert an input_layer into a bbox polygon in an output_layer. The whole process ran over a couple of seconds to invert a 25MB shape file. Better than crashing out with a call to ...


1

The answer to your question is yes. You might like to clarify what kind of server-side software you have. You can use GeoServer to do WPS requests. You could use a Python library like Shapely. Or a C# library, or a Java library, or a JavaScript library. Or the QGIS API, or the ArcGIS API or the database, be that SQL Server, PostGIS or Oracle. So, to ...


1

I see two fixes: For the first error: ERROR 000161: The length of the grid name must not exceed 13 characters Convert your output to tiff format, which does not have the character length limitations that the Esri grid raster format does. mamcnty_out = os.path.join(output_workSpace, "cnty_" + species_str + ".tif") For the second error: ERROR ...



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