New answers tagged shapefile
1
Couple of suggestions: run a check geometry tool on your layer that you wish to clip, you could then follow that up with a repair geometry if it finds errors. You may wish to do that on a backed up copy.
Are the corrdinate systems different? Are you trying to clip a dataset in decimal degrees with a dataset that is in meters or vice versa? If so reproject ...
1
You cannot add data from a shapefile directly to the MapView. You can only add various types of Layers to the Map View. See this Page for more details: Map layer types
You could however create a Map Tile Package from a mapservice and use it instead if you desire offline access, by using it in a Local Tile Layer
0
Using MODIS REPROJECTION TOOL WEB INTERFACE (MRTWEB) i was able to convert the .hdf files to .tiff format and reproject to geographic coordinate system. The boundary shapefile was also given geographic coordinate system and the boundary fell correctly over the image in ArcGIS9.3
4
Yes, you can use UTF-8 characters in shapefile attributes. The document (http://support.esri.com/en/knowledgebase/techarticles/detail/21106) explains it in detail.
1
Opening the dxf with Add Vector layer and labelling with text datafield gives almost the same as Autodesk Design Review:
The DXF file contains points and polygons in the same layer. This is not allowed in shapefiles. That is why you can not save it as a shapefile.
Exporting as kml will work, as this format supports different geometry types.
You have to ...
1
Hey If it is a case that you want to load it into Qgis and display the lables just do it that way there is no need to put as shapefile.
Sorry on further reflection and looking at the data. Why not load as dxf and split vector layer. load them in as shapes then.
I seem to get most text come through.
Or perhaps split the layers in autocad and save as ...
0
i tried with QGIS 1.8.0 on Ubuntu 12.04 LTS (x86_64) with dxf plugin and only a single attribute is getting copied to shapefile. From the attribute data of converted shapefile it seems like dxf converter plugin just adding a new attribute field myid to every feature rather than copying data from source dataset. It will be good to inform QGIS developers may ...
2
There are a lot of options. OpenLayers or Leaflet are probably a good place to start for the client side and they can read local shapefiles. For more options have a look at the OsGeo website (especially note the webmapping links on the right hand side).
0
WRITE_BBOX parameters is supported for OGR >= 1.9.0.
FwTools contains previous version of OGR.You should download the latest installer version (for now 1.10.0) from here.
2
Try just setting project CRS and enabling on-the-fly reprojection. Don't touch the layer properties. If the Shapefile .prj definitions are read correctly by QGIS, that's all you need to do.
Similar questions:
Why don't my Shapefiles and OSM data overlap in Quantum GIS?
QGIS layers no longer overlay when Enable 'on the fly' CRS transformation ...
0
As such, the .osm format is a very simple format. It just contains the various nodes, and then the ways that are formed from these nodes. You could whip up some custom code which does this, quite easily.
Additionally, there are quite a few libraries/projects which can be used to convert from .osm format to shapefiles; Many of them have been linked on this ...
0
One way of doing it is to generate a really simple XML tree for each record in your spreadsheet, write an XSLT stylesheet to translate from your simple XML to ISO 19139, then use lxml.etree.XSLT to transform.
The major advantage of this is it keeps the complex iso19139 XML out of your python code which makes it much easier to debug. Some more ...
2
To summarize the very useful comments by @Spacedman, @JeffreyEvans and @AriB.Friedman, but also to address the questioner's second problem about saving the generated subset and to provide a reproducible example for future audience, let me add a brief example to cover the whole topic. In fact, I'm much more often working with raster data than point or polygon ...
5
In ArcMap 10.1:
Clip the dataframe to the extent of the layer.
Dataframe Properties > Data Frame > Clip Options
You could also clip a new shapefile based on the county boundary. There are probably more ways, but these are the first that come to mind.
0
ok this was easier than i thought: spatial.subset<-states.shp[5,] if you know which line in your attribute table should be the subset. If you don't know you could do something like spatial.subset<-states.shp[states.shp@data$STATE=="California" ,] for a single state or spatial.subset<-states.shp[c(states.shp@data$POPULATION>1000000),] for several ...
6
My understanding is that the shapefile format has not changed since this 1998 document.
5
I try to avoid using shapefiles as you cannot store domains, relationships, aliases etc. but they are the most portable format when distributing data to other people who are using different GIS systems/tools.
Whilst file geodatabases give better performance and are capable of storing huge datasets, everyone above is giving the humble personal geodatabase a ...
1
if you want full-blown geodatabase capability (Coded Value Domains, Relationship Classes, Topologies, Geometric Networks, etc blah blah, without the complexity or admin overhead of relational geodatabase, AND/OR you want the fastest drawing, cursor, and geoprocessing performance, File Geodatabase is the way to go. Local disc access is much faster than a ...
4
I generally use FGDBs, but it really depends on what you need to store. Like the other posts have mentioned, Personal GDBs are outdated and have size issues.
Using a geodatabase allows you to set up a topology, which you can't do with plain shapefiles.
Shapefiles hold the exact coordinates of the shapes. In a GDB, the locations are snapped to the nearest ...
3
Most people would recommend storing your data in a database for performance reasons, i.e quick to query and search. However I believe there is also the benefit of currency when data is in a database. For example, if you pass a shapefile to a colleague they are likely to use that indefinitely but the data may have been updated. Where as if the data was stored ...
18
At a high level the way I choose is based on whether users are inexperienced and need nothing more than points, lines and polygons. Shapefiles are ideal for this.
If they need annotation, domains for pick lists and validation, raster, etc then use File Geodatabases which are easy to use, fast and can be massive in size.
I would never use Personal ...
0
You can get the indices from The National Map in pretty big pieces, it won't let you download the whole country at once but it wouldn't be too terrible to download 4-5 large pieces and then stitch them back together. Well, it shouldn't be...
The index that I have is from ESRI, from the metadata it looks like it shipped with the map data package they used ...
4
The USDA Data Gateway has layers available for 1:12k quad footprints. Not sure if you can fetch the whole U.S. or not, but you can get them by state. Also, you can drag a custom AOI onto the map and get some pretty big chunks it looks like.
2
I'm not sure solutions to this problem have anything to do with deleting files, so pyshp probably works fine. Here's how to split a Natural Earth shapefile feature-by-feature with Fiona:
import os
import fiona
dest = "/tmp/countries/"
infile = (
"/Users/seang/data/ne_50m_admin_0_countries/"
"ne_50m_admin_0_countries.shp")
with fiona.open(infile) ...
0
I am not familiar with python, but I have designed an implementation for you in ArcObjects. This code will loop through all features in a specified shapefile for you, where inputshpFilePath is the full filepath for your input shapefile.
ESRI.ArcGIS.Geodatabase.IWorkspaceFactory pWSFact; //create general workspace factory (this is the directory you ...
0
I'm unsure but is this a possibility to allow the exec shp2pgsql and exec psql commands only, based on who is logged in?
http://www.juniper.net/techpubs/software/junos/junos95/swconfig-access-privilege/id-10521195.html
Any one has experience on this? Thank you.
5
I would recommend clipping the raster to the shapefile, then in the resulting raster you can look at the number of cells present for each of your classes. The area can be calculated by multiplying the number of cells by the area covered each pixel (cell size squared).
It's a different approach than the equally valid solution offered above but from a ...
3
This can be accomplished using three main steps:
Convert your raster to polygons using the Raster To Polygon tool
Overlay your polygons (from raster) with your shapefile using the Intersect tool or Union tool - which depends on how many polygons you want output
Tabulate your results using the Summary Statistics tool (or perhaps the Tabulate Intersections ...
1
I'd recommend having a look at the OSGeo site. They have loads of information about open source GIS from all parts of the spectrum. Look at the right hand side of the home page and you'll see 'Web Mapping' which lists a bunch of Open Source applications you can use for web mapping.
At my organization we personally use (which many others also use) GeoServer ...
1
I just tested this and it worked!
The layer file that I added, and then changed the data source of, was saved from a layer called dummy that pointed at a dummy.shp file.
import arcpy
mxd = arcpy.mapping.MapDocument("C:\\MAPS\\map.mxd")
df = arcpy.mapping.ListDataFrames(mxd,"Layers")[0]
addLayer = arcpy.mapping.Layer("C:\\SYMBOLOGY\\symbology.lyr")
...
1
I haven't tested this out, but the easiest way should be to simply rename (or copy) symbology.lyr to points.lyr (the same basename as your shapefile). Generally speaking, when you load a shapefile into ArcMap that has a similarly name Layer file, the symbology of the layer "follows" the raw data (shapefile) and is applied on load.
0
When we needed this, we just pregenerated a zip file for each layer, and had a link in a custom legend which allowed you to download the data, and just housed the zip files on the site. Not 'slick and automatic', but it gives a way for the user to download the data if they want.
1
As a footnote to this and a shameless author's plug, the free sDNA (spatial Design Network Analysis) plugin for ArcGIS can do this, among other things that may be of interest to you.
You would first need to ensure your network was correctly noded (i.e. all lines breaking where there are junctions; Topology->Planarize can do that).
1
After finding this comment, I searched for this spatial_ref_sys table and inserted it into to my PostGIS database.
Reloaded the shapefiles into PostGIS in ESPG: 900913.
Restarted TileMill, added my PostGIS layers, and they are all layered correctly.
2
In your script, you are creating a temporary layer without saving anything permanent. Use Copy Features (Data Management) to make your layer permanent:
arcpy.CopyFeatures_management (lyrOutFile, out_fc)
1
After making your event layer use the feature class to feature class method, see example below:
# Process: Make XY Event Layer
arcpy.MakeXYEventLayer_management(InputCSV, "lng", "lat", Book1_Layer, "", "")
# Process: Feature Class to Feature Class
arcpy.FeatureClassToFeatureClass_conversion(Book1_Layer, outputDir, fcName)
For geoprocessing tasks you can ...
0
You can find what you looking for in:
http://www.gadm.org/
Regards
3
You could also do this using a simple model in Model Builder.
Where the input file is your original file you want to split and the expressions are the definition queries selecting the records you are interested in exporting to a new shapefile.
1
GML formats are good enough to be converted to GeoJSON. GML is another form of xml which is a document interchange format and Javscript Object Notion(JSON) is a data interchange format. The good thing is both can be opened in a text editor and can be saved in databases. ShapeFiles have some limitation for the length of fields and attribute values. But ...
3
You can use select by attribute to select the Field Values. then Export the selected features using @MappaGnosis answer.
Another Method: using Definition Query in layer properties. you can query based on values and export each query.
There is a tool named Split Layer by Attributes that you can use to split the layer by select a field .
5
If you are wanting to export your group of features, use your classification to select them and then right-click the item in the table of contents then go Data->Export Data. In the Export Data dialog box make sure you click 'Selected Features' from the Export drop-down menu.
3
ESRI Shapefiles are more widely used, but have some limitations, including that the attribute names are limited in length. Shapefiles can be edited by the wonderful QGIS.
MapInfo files are less widely used, and have a limitation with respect to something called bounds, where the X, Y coordinates are stored as an integer between two doubles. This limits the ...
0
I'm not familiar with this software so I downloaded it to have a look. A couple of things:
Do you have the latest version of this software?
Do you have a paid license for this software? If so, perhaps the developers have an answer for you.
Maybe you could try changing the spatial type at the bottom right of the conversion dialog box. See below:
5
GetField returns UTF-8 encoded strings and you'll want to decode it before you process it in any way. Then you encode the result to pass it to SetField. You've got it backwards.
Fiona (shameless plug) deals in Python unicode strings and so is simpler to use.
Unidecode (https://pypi.python.org/pypi/Unidecode) is handy for stuff like this because it will ...
0
According to the documentation (scroll down to Adding Shapefile Layers section), you don't need to name the layer if the source is a shapefile. Maybe this is causing the problem?
"layers": {
"src": "roads.shp"
},
I don't think you need to include "simplify": false, since it appears that "simplify" is only necessary when you want to define the level or ...
0
If you only want PA congressional districts:
Only download the PA congressional districts - tl_rd13_42_cd113.zip.
It will be smaller, faster, and you will not need to filter, modify. The census data is available but sometimes difficult to understand,interpret the file names and fields. If you nose around a bit, you can find file name definitions and ...
2
TAB files are almost always more compact than SHP, have better "codepage-awareness" and the DAT part allows more specialized field types, that maps better to the database, where the data is coming from (assuming it isn't TAB or SHP).
But SHP files are more "standard" and open, so if you run into issues, it may be easier to deal with them, if you have SHP.
0
AFAIK GeoJSON will give you very easy and pretty fast import/export ways of dealing with your data sets. I use it all the time with postgis and web mapping. Especially for web mapping, this format is easy to work with.
1
Here's a solution. Better late than never:
http://geospatialpython.com/2013/04/add-field-to-existing-shapefile.html?m=1
Top 50 recent answers are included








