Tag Info

New answers tagged

0

Note that easy_install is run from the command line, not the python console.. So from a terminal window in linux, cmd in Windows etc. I'm sure that in the past I've just downloaded the shapefile.py to the project source folder. This library is pure python, consists of one .py file and has no external dependencies, so try that if you can't get easy_install ...


1

If you want to use 4 colors for all your features, you can use the following approach with a categorized style: Please add a sketch for your third point ("A chunk of n points in a single large polyline."). I can't imagine what that should look like.


0

On Windows: Save text file as a "batch file" by changing the file extension from ".txt" to ".bat" double-click that file and away you go.


0

I just used the below code to transfer a shapefile into PostGIS. I saw your post and thought it might help. The Shape@WKT makes it really easy to transfer the geometry. Everything is hard coded and works which I am happy with and will probably revisit at a later date when my coding improves. If anything is not clear please let me know. import psycopg2, ...


2

They're well hidden! I found a directory with archives of shapefiles here. There's some documentation here. It looks like the polygons aren't updated regularly, but you can sign up to the mailing list to find out when they are, according to that document. If you download this archive (33MB), the forecast zones are in land_CLCBaseZone_detail_proj.shp. (The ...


1

I think the module your looking for is pyshp. if it isn't installed, open your osgeo shell and enter easy_install pyshp


1

geocode the points of interest. then take your road centerline shapefile and create a buffer around it that is adequate for your needs (as some points of interest may be 40' off the road, etc) then do a spatial join of all POIs that fall inside the road buffer.


1

You have to use the subset method (see ?subset.Spatial): subset(lines, X > 400 & Y=="YES") Alternatively you can use indexing operations via []: lines[lines$X > 400 & lines$Y=="YES", ] Your dplyr code filters just filters the data frame, but not the geometry.


0

In the Online Help for ArcGIS 9.3.1 there is a page that discusses its KML support: Importing KML into the geodatabase for use in ArcMap, ArcGlobe or ArcScene See the Data Interoperability Extension. Alternatively, see how the user community is supporting KML by reviewing live search results for KML in ArcScripts


1

I don´t know if ArcMap 9.3.1 has the tool. But there is a Tool called "KML to Layer". You need tho export the temporary layer to shp. If not use this online conversion: http://www.zonums.com/online/kml2shp.php


0

Depending on whether you want a mean or a spatially weighted mean there are a couple things you can do using the rgeos and raster packages library(rgeos) proj4string(grid) <- proj4string(nuts) # I assumed these were the same projection? First find out which grid cells intersect your NUTS polygons grid_nuts <- gIntersects(grid,nuts,byid = TRUE) ...


4

A shapefile is a simple, nontopological format for storing the geometric location and attribute information of geographic features. Geographic features in a shapefile can be represented by points, lines, or polygons (areas). The workspace containing shapefiles may also contain dBASE tables, which can store additional attributes that can be joined to a ...


0

ArcGIS often throws a topoengine error when it runs out of memory while running in 32 bit mode and performing overlay operations. To get around that I either chop-up the job or use 64 bit geoprocessing with lots of RAM and Repair Geometry on all input features (create local copies first if you don't want to mess up your inputs with the repair).


0

If you are trying to create a shapefile for each station with these 31 fields (daily weather readings) and your rows contain weather station records, you are making a logical mistake. Your Make XY Event tool expects two fields to yield locations but Iterate Field will return only one (field, field value). So, the tool becomes blank expecting to be introduced ...


1

This should be a comment, but it's too long so I've added it as an answer to provide a little more info: @TsvGis County and Parish are no longer part of legal descriptions of land. The do still feature on survey plans and property contracts, but more so for historical reference purposes. Parish boundaries were drawn on Parish Maps which were fairly small ...


0

a work around would be to parse the description field for the values of the various attribute fields you need and copy them into the appropriate fields. And next time, get your client to add attributes into an excel spread sheet or something so that you can just join it back to your shapefile for updating.


2

After taking @PolyGo's suggestion, I contacted QSpatial regarding if a parish boundary dataset exists for Queensland (Australia) - this was the response: "Parish names and boundaries are actually historical information. Parish mapping and the parish information in the DCDB has not been maintained for many years. Unfortunately as the parish boundaries are ...


0

Here is a guide that I found that walks you through some steps using ArcMap, Google Drive Fusion Tables, and MS Excel to convert KML files to .shp files while preserving the attributes. Link to site that has the guide.


0

Try to use ogr with python. Step 1: Open you VMAP file using QgsVectorLayer vlayer = QgsVectorLayer(<VMAP location>+"|layername=<VMAP filename>", <newLayeName>, "ogr") if you get True after you run this line it means the VMAP was properly loaded. Step 2: convert the vlayer to Shapefile vlayerToShape = ...


2

I think another way of doing this is to just add the text file to ArcMap, display by x,y coordinates, and join to your to your original shapefile. You can then export the resulting shapefile (or just the table) as whatever you want.


3

This is a reasonably simple problem to solve in ArcGIS. Open the Shapefile (it's not a "raster shapefile" btw; there's no such thin). Add two fields to your shapefile. One for Lat, one for Lon. Both should be of type Float or double. Populate one of these fields with the X, and one with the Y value for the point. (Using "calculate geometry"). Now, create ...


1

Apparently there seems to be no such source... the closest I could get to is using textual sources describing the time zone changes in detail for different admin areas and then composing the shapefiles myself from available shapefiles of the Russian admin areas, e.g. with QGIS or ArcMap. The best text sources describing the changes that I could find are: ...


3

You need to set a definition query (see link in @PolyGeo's answer) to show only the selected features that you wanted labeled. This can be done through the definition query tab in properties or through the labelling options called label classes (note - see @ChrisW comments below). I use these solution quite regularly and find them easy to do.


1

You need to write an expression in the label tool, to make only your desired values visible. Double-click the layer properties and select the label tab. Locate the "Expression" button and select it. Now you have to write the expression that will visualize only the desired values. You can choose between VBScript, Python, Jscript. You will need to check ...


3

The Symbology tab of the Layer Properties does not perform any selections. If you want the same features to not be labelled, I recommend that you apply a Definition Query instead: When you specify a dataset that you want to draw as a map layer, you often only want to draw some of the features in the dataset. In these situations, you can define a ...


2

You should be able to get this from the Queensland Spatial Catalogue (QSpatial). The Cadastral (DCDB) datasets, at least for each Local Government Area (LGA), have a field for PARISH, which can be used to dissolve them out. The only catch is that there will be gaps in the dissolved parishes that represent the roads. I think that it is quite likely that ...


0

OK Guys and Girls, I think toms pretty much nailed the problem. The site was running locally on my PC, i edited the html,css and javascript with an editor and opened the html dircetly in the browser. Only Firefox displayed the zipped shapefile. The problem seems to stem from the fact that only Firefox allows locally hosted files, which took me quite a ...


0

All the g.. functions seem to discard the data by design, and you have to fiddle them back into a spatial dataframe (Don't ask me how...) Try using the union from the raster package. Haven't tried union, but intersect etc. worked as expected, producing spatial dataframes.


0

Are you running this locally? In the Chrome console (F12) I get a cross origin error on your zipped shapefile when trying to open index.html from the file system. XMLHttpRequest cannot load file:///C:/Users/web/kaystros_osm_Project.zip. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, ...


1

There's a better library for reading really large shapefiles - fastshp. Doesn't seem to be available in repositories but the .tgz binaries are here. Here are the results for rgdal and fastshp with a 130MB shapefile with 32,545 features: library(fastshp) library(rgdal) system.time( test.fastshp <- read.shp("tz-landcover-ge.shp") ) # user system ...


0

No, it will not work (unless you're just using the import to define the CRS to what you know it is supposed to be). When importing to a feature dataset, everything must end up in the same CRS. The import process can automatically project from the source CRS to the feature dataset's, but in order to do that it has to know the source CRS in the first place. If ...


2

zoom to the extent you're after optionally, ctrl-b to save the extent rectangle select the polygons (drag over the whole canvas extent) vector > geometry tools > buffer (selected features only, distance .001 or less, dissolve results) This will expand the coastline outwards just enough to overlap across the line, the dissolve will 'heal' the gap. You ...


1

I have solved this issue now and for those interested, the code is posted below... I help you all find this helpful: public final class ExportLayerToShapefileAction extends SelectionAction { public ExportLayerToShapefileAction() { super("gsExportToShapefile"); } @Override protected void doActionPerformed(ActionEvent e) { IFeatureSelection ...


1

Double click your layer in QGIS, find the Label menu, label your layer.


3

You want to do a left outer join on the shapefile's data.frame (data db) with the new table (table data). That will keep all the existing rows of your 'data db', join the appropriate fields together, and fill in missing data for rows that don't match. I'm assuming you're reading the shapefile as an sp object (using rgdal package in my example). I also ...


2

Copying and pasting into a shapefile table isn't enough for ArcGIS to read the geometry. Try to right-click the shapefile you created and go to "Display XY data" and specify the correct fields for your coordinates as well as the coordinate system. If you don't have that option, try this: Do a "Save As" on the Excel file and make it a .csv. In ArcCatalog ...


1

Start ArcGis and add data to the Data Frame, if needed. Right-click the layer and select Data > Export Features. Click the Browse button. Navigate to the location where you want to store the shapefile. Type a name for the new shapefile Click the Save button. Click OK. http://imgur.com/HpCSdOr


2

OSGeo has a Public Geodata for the UK list. The second link is for boundary data. You may also want to look at data.gov.uk Boundary-Line data


2

Do you want to change the extent of the actual data or just the plot? If it is just the plot you can use ylim and xlim to define the extent of the plot. Create some example data library(sp) x <- SpatialPointsDataFrame(SpatialPoints(cbind(runif(10, -115, -110), runif(10, 30, 45))), data.frame(ID=1:10) ) y <- ...


2

Merge is not doing what you want, probably because there are only two unique values in HJ or ZX. The merge columns should uniquely identify each record in oikismo and df1. Change your by.x and by.y appropriately.


0

You should note that str is telling us that you have 25413 observations, not 200, in your "a" @data (data.frame) object. You could have a multi-part shapefile where numerious records are associated with each spatial location. If the results of dim(a) and dim(a@data) differ this is likely the case. This is why you provide as much information as possible in ...


2

The mistake is in this line: layer = self.iface.addVectorLayer("D:/python/cropped_area.shp", "sample_cropped area","ogr") The layer is added anew each time selectFeature is fired. You'd rather want to add the layer once (e.g. in the __init__ or initGui function), and save it to a member of your plugin object (e.g. self.layer=addVectorLayer(…)) so you can ...


0

This is how you can reproject a raster in R using the raster package. In this example, the input geotiff was in a NAD83 geographic coordinate system and I reproject to a NAD 83 UTM 15 projected coordinate system. A good reference for Proj4 format projections, which are used by RGDAL, can be found at spatialreference.org. library(raster) # Create ...


6

Esri shapefile fields are limited to 10 characters, no matter how they are created.


1

You may want to consider to tell us why the above code didn't work, i.e. include the referring error message. I just tried to reproduce your issue using the German border from the countriesCoarse dataset included in the rworldmap package and everything worked out fine. Remember to set the projection and the desired extent of your raster template properly, ...


3

Here's a suggestion: # Use rgdal, better library library(rgdal) coastline <- readOGR(dsn=".", layer="coastline") wets <- readOGR(dsn=".", layer="wets") Rasterize 'em: require(raster) # Create a generic raster, set the extent to the same as wetlands r.raster <- raster() Use extent (from raster package) to read bounds of vector and assign to ...


1

Using shp2pgsql and pgsql on a Mac system but the principle should be the same as what follows here. Load the modified shapefile into a temporary table; Update the correct row of the original table with only the geometry from the modified shapefile. Load the modified shapefile into PostGIS (I use the Bash pipe ('|') here to send the SQL from shp2pgsql ...


1

SQL query is wrong, it should be: result = dataSource.ExecuteSQL("select * from roi_classMacro WHERE C_info = 'g19' or C_info = 'g22' or C_info = 'g23'") For attribute filter try: mylayer.SetAttributeFilter("C_info = 'g19' or C_info = 'g22' or C_info = 'g23'")


2

Given you're supplying the shapefile data in it's entirety back into Postgres when reissuing the shp2pgsql command, the only way would be to import to a temporary table and copy across the rows that are different to your original. By the time you've had to compare every row, you might as well have replaced the whole thing with the temporary table anyway. ...


1

Oracle Spatial comes with a collection of Java APIs, and one of them lets you read shapefiles. That API is documented here: http://docs.oracle.com/database/121/SPAJV/toc.htm. Look for the oracle.spatial.util package, specifically class ShapefileFeatureJGeom. It uses lower level classes that perform the actual reading of the shapefile (DBFReaderJGeom and ...



Top 50 recent answers are included