Spatial Views with SQLite

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Spatial Views with SQLite

Gunter Becker
Hi,

I'm trying to display a spatial view from SQLite in MapGuide 2.2. As you can guess without any success.
I've created the view insde the SQLite Manager AddOn for Firefox. When I display the view in the GUI everything seems to look fine.

Steps I've done already:

1. Create a view like this:

  CREATE  VIEW points
  AS
  SELECT a.id,
        a.nr ,
        b.geometry,                
        b.drehwinkel * 57.296 AS angle
   FROM a JOIN  b
     ON a.id = b.p_id

2. Insert View in Metadata-Table 'geometry_columns':

   INSERT INTO geometry_columns (f_table_name, f_geometry_column, geometry_type, coord_dimension, srid, geometry_format)
   VALUES ('points', 'geometry', 1, 2, 28532, 'WKB');

When trying to connect to sqlite in Maestro or FDOToolbox then the view seems to be recognised as a spatial class. FdoToolbox shows a spatial icon in the 'Object Explorer' and the 'Map View'- Tab is visible when querying the data. Instead of displaying it correctly on the map it shows the geometry-column as a column in the 'Grid View' with value '<null>'

As you can see from Jackies post it must be possible to display a spatial view. But not for me.

Anyone else who got this to work? Do I have to add some more metadata into sqlite to make my view visible to MapGuide (FDO)?

Thanks, Gunter

Reply | Threaded
Open this post in threaded view
|

Re: Spatial Views with SQLite

Jackie Ng
There's 2 extra metadata tables you may need to fill in

fdo_columns: To describe the FDO data properties
spatial_ref_sys: To describe the FDO spatial context for that the geometry property's SRID is describing.

Finally there's also a UseFdoMetadata connection property for the SQLite provider that tells the provider to use these tables or make an intelligent guess if false or not specified. It's probably making a bad guess?

- Jackie