Does anyone know where I can find a sample shapefile that has null entries in it (preferably a polygon shapefile)? I'm not sure how to create one with null entries.
Thanks, Jeff
|
Does anyone know where I can find a sample shapefile that has null entries in it (preferably a polygon shapefile)? I'm not sure how to create one with null entries. Thanks, Jeff |
|||
|
|
|
Be warned that a lot of software reading SHP files do not support null-values for the geometry. Even older versions of ArcView had problems. I have created a sample here: http://www.routeware.dk/temp/shp_null_sample.zip It has 3 records, the 2nd has no geometry. |
|||||||||||||
|
|
You mean null for the geometry/shape column correct? Because shpfiles don't support null for any field type except the geometry and (i hear) for date fields. Anyways, code below create 1 shpfile with 1 record/feature that has a null poly geometry.
I run it and get this which is what i'd expect WARNING 000442: null geometry at 0 in c:\temp\outfc.shp |
||||
|
|
|
If you are working on ESRI software, at least I can speak for ArcGIS 9.3, then shapefiles do not support nulls. I ran into this problem a few weeks ago and spent a day investigating. I found this link particularly illuminating http://forums.esri.com/Thread.asp?c=93&f=993&t=125464. It seems the only way to support nulls within ESRI shapefiles is to use geodatabases (then the shapefiles become featureclasses. I used file a geodatabase). To support nulls, I ended up making a geodatabase and creating the featureclasses (otherwise known as shapefiles) inside the file geodatabase (this will support nulls) as opposed to creating a shapefile and then importing it into the geodatabase (this will not support nulls). If I remember correctly, you also have to explicitly state in the field properties that you want nulls to be supported. Here is the link that might help How to create a feature class in a file geodatabase in ArcGIS 9.3 with Python? |
||||
|
|