shapefile

Character encoding for US Census Cartographic Boundary Files

I'm trying to import the US Census cartographic boundary files (available here: http://www.census.gov/geo/www/cob/bdy_files.html ) into a GeoDjango application. However, python is complaining about UnicodeDecodeErrors (for example, for the non-ascii characters in Puerto Rico). The shapefile description file (*.dbf) doesn't specify what...

How can I make kml data look like google maps?

I have a program that generates a .shp file, and exports this as a kml file. I would like to be able to display my output using the standard google map 'map' style (gray background, yellow streets, etc) in google earth, or in the google earth api. Is there a style guide or method that I should be using? Any thoughts appreciated - I was...

Intersections of 3D polygons in python

Are there any open source tools or libraries (ideally in python) that are available for performing lots of intersections with 3D geometry read from an ESRI shapefile? Most of the tests will be simple line segments vs polygons. I've looked into OGR 1.7.1 / GEOS 3.2.0, and whilst it loads the data correctly, the resulting intersections ar...

How to specify numeric width and precision when creating a dBase database?

We need to be able to create a dBase database (.dbf file) containing numeric columns with specific width and precision. I seem to be able to set the precision but not the width. The following code shows my connection string and my command text. using (OleDbConnection oConnection = new OleDbConnection(String.Format("Provider=Microsoft.Je...

How can I convert a projection that's not part of spatial_ref_sys?

Hi, I'm importing shapefiles into a Postgres+PostGIS database. Here's my usual procedure: * Find an srid in the spatial_ref_sys table where srtext appears to match the shapefile's .prj file * Upload the data into a new table using the shp2pgsql utility, specifying the srid using the -s flag * Add the new table to my main geometry table...

How to very efficiently assign lat/long to city boundary described by shape ?

I have a huge shapefile of 36.000 non-overlapping polygones (city boundaries). I want to easily determine the polygone into which a given lat/long falls. What would the best way given that it must be extremely computationaly efficient ? I was thinking of creating a lookup table (tilex,tiley,polygone_id) where tilex and tiley are tile id...

How do I draw the points in an ESRI Polyline, given the bounding box as lat/long and the "points" as radians?

I'm using OpenMap and I'm reading a ShapeFile using com.bbn.openmap.layer.shape.ShapeFile. The bounding box is read in as lat/long points, for example 39.583642,-104.895486. The bounding box is a lower-left point and an upper-right point which represents where the points are contained. The "points," which are named "radians" in OpenMap, ...

Combining bordering shapefiles in R

I have five shapefiles of bordering counties in California that I am trying to combine into one large shapefile and maintain the original borders of the counties. I then want to plot points such as this so the map only needs to be a simple map of county boundaries. Is there a way to do this in R or will I have to use something like Arc...

How can I convert a shapefile from AGD66 to GDA94 from a script, using open source libraries

How can I convert a shapefile from AGD66 to GDA94 programmatically, using open source libraries? I don't want to use arcgisscripting because I don't have a licence. This needs to be automatable. A bash or python script would be acceptable. This is a little more complicated than a normal reprojection, because a different ellipsoid is ...

Importing ShapeFiles into Oracle XE

Hi, I'm looking to import one of the Shapefiles supplied with the Ordnance Survey Boundary-Line opensource set into Oracle XE. http://data.gov.uk/dataset/os-boundary-line Unfortunately I'm completely unsure how to go about this, despite much Googling. Anyone got any pointers or tips or a link to a guide? Cheers James ...

Split or save a subset of a ESRI Shape SHP file to a new file?

I'm working with shape files in GeoDjango. Right now I'm trying to write a test for code that loads in a shape file and saves it to a database. The shape file currently has a feature count of 64,118. I'd like to reduce this to a handful so the test can quickly load it and confirm everything is right. Since shape files aren't in a tex...

How Can I Proj4 details from the Shape File's .prj file ?

Hi I am using mapdotnet services for our gis application to load the shape files and this mapdotnet service want the proj4 details and that getting from the spatialreference.org but for this proj4 details is blank. any other way to get it. Below is the .prj of the shape file- PROJCS["NAD_1983_HARN_WISCRS_EauClaire_County_Feet",GEOGCS...

How can I convert an excel spreadsheet (.xls) to a shapefile programmatically?

I have an excel spreadsheet I want to convert to an ESRI shapefile programmatically. It contains X and Y coordinates in two columns, as well as a variety of attribute data in other columns. The spreadsheet is in excel 97 format (i.e. not .xlsx). I would like to be able to convert this to a point geometry shapefile, with each row's x,y...

Representation of road topology in a GIS file.

Hello All, I'm just getting into GIS right now with a new project at my work - so I'm still kinda new at all of this. I'm using GDAL to work with the TigerLine Shape files from the previous US census land survey. Within these files you can find (among other things) polyline sets that describe lat/long position of roads and you can fin...

shapefile with openmap

I have us state border shape file and I want to read information from that file using openmap api for java.Also to find the states within 50 miles of a given city. How can i do it? ...

Converting a CAD file to a shape file

Hey folks: Thanks for the assist on my previous question.... I was able to complete my project This time I have a CAD file created with Autodesk that I need to convert to a shape file. Couple of questons: An open source application (can't afford ESRI) that can convert the CAD file to a shape file? Is that a better file format I can u...

How to convert an ESRI Shape-file into SQL Server 2008?

I have a shapefile that I would like to upload to a spatial SQL Server 2008. I have tried using this tool: SQL Server 2008 Spatial Tools. But without luck. Does anyone know any other (free) tools for doing this? ...

Intersecting Points and Polygons in R

Hi, I am working with shapefiles in R, one is point.shp the other is a polygon.shp. Now, I would like to intersect the points with the polygon, meaning that all the values from the polygon should be attached to the table of the point.shp. I tried overlay() and spRbind in package sp, but nothing did what I expected them to do. Could a...

Reading a Shapefile with ColdFusion

I am trying to read a binary file and parse the bytes I have the white paper spec on Shapefiles to know how to parse the file, however I cannot seem to find the correct functions in ColdFusion to handle reading bytes and deciding what to do with them. <cffile action="READBINARY" file="mypath/www/_Dev/tl_2009_25_place.shp" var...

Using OpenMap API which class do I use to extract point data from the shapefile?

I am currently using Shapefile class and ColdFusion to go through the "records" of each shapefile. Each record has a bounding box and i am able to get this information but havent found a way to actually retrieve the points inside each record. Can someone shed some light on which classes to use and how to use them? This is the exact sa...