This project is read-only.

Spatialite features

Apr 5, 2012 at 6:47 AM

Hi, I have been trying to get my shapes loaded trough the use of the Spatialite extension.

I imported some shape files into a spatialite dB using the “spatialite_gui.exe” program.

When opening it with Dotspatial => DotSpatial.Plugins.SpatiaLite.SpatiaLiteHelper.cs
the line in GetGeometryColumns: gci.CoordDimension = Convert.ToInt32(r["coord_dimension"]); throws exception because it is not finding the coord_dimension as a integer(Input string was not in a correct format.). I have checked what r["coord_dimension"] is returning and in my case it is a string “XY”.

Ok so I got past that by just for time being commenting out the line, my shape is loading but when I want to do a identify on a feature there is no data listed in the feature identifier. I tried to populate the attributes but with no success.

If I try to do Labeling on the features the program also throws exception but I think that is also related to the attributes not loading.

If I check the data with the attributes table I can see all the data is populated.

Can anyone maybe send me in the right direction for trying to fix this, or  maybe I need to import my shape data differently?

Thank you!

Apr 5, 2012 at 2:09 PM

As for spatialite 2.4 the coordinate dimension entry in the geometry_columns table has changed from integer to string to resolve the ambiguity of 3 being possible for XYM and XYZ.

2 -> 'XY'
3 -> 'XYZ' or 'XYM'
4 -> 'XYZM'

You can try and change the coordinate dimension entry to a numeric equivalent and see if it works.

Hth FObermaier