Firstly, many thanks for taking the time to reply, Brooks, and for your
helpful suggestions.

 

I tried explicitly adding the geom type and projection by modifying the VRT
file as follows:

<OGRVRTDataSource>

  <OGRVRTLayer name="AASQLlayer">

 
<SrcDataSource>MSSQL:server=zangief\SQLEXPRESS;database=Spatial;trusted_conn
ection=yes</SrcDataSource> 

    <SrcSQL>SELECT TOP 10 geom27700.STAsText() FROM
TGSettlement_Area</SrcSQL>

    <LayerSRS>EPSG:27700</LayerSRS>

    <GeometryType>wkbPolygon</GeometryType>

  </OGRVRTLayer>

</OGRVRTDataSource>

 

ogrinfo now reports:

INFO: Open of `mssql.ovf'

      using driver `VRT' successful.

 

Layer name: AASQLlayer

Geometry: Polygon

Feature Count: 10

Layer SRS WKT:

PROJCS["OSGB 1936 / British National Grid",

    GEOGCS["OSGB 1936",

        DATUM["OSGB_1936",

            SPHEROID["Airy 1830",6377563.396,299.3249646,

                AUTHORITY["EPSG","7001"]],

            TOWGS84[446.448,-125.157,542.06,0.15,0.247,0.842,-20.489],

            AUTHORITY["EPSG","6277"]],

        PRIMEM["Greenwich",0,

            AUTHORITY["EPSG","8901"]],

        UNIT["degree",0.0174532925199433,

            AUTHORITY["EPSG","9122"]],

        AUTHORITY["EPSG","4277"]],

    UNIT["metre",1,

        AUTHORITY["EPSG","9001"]],

    PROJECTION["Transverse_Mercator"],

    PARAMETER["latitude_of_origin",49],

    PARAMETER["central_meridian",-2],

    PARAMETER["scale_factor",0.9996012717],

    PARAMETER["false_easting",400000],

    PARAMETER["false_northing",-100000],

    AUTHORITY["EPSG","27700"],

    AXIS["Easting",EAST],

    AXIS["Northing",NORTH]]

: String (0.0)

 

However, I still get the same error with mapnik. 

 

I then tried the solution given in the link you provided, by using OGR2OGR
to first import data into SQL Server so as to create the spatial_ref_sys and
geometry_columns tables.

I'm not sure why these tables should be required, but I can see that they
are referenced in the ogrmssqlspatialselectlayer.cpp file. 

 

Unfortunately, creating these didn't help in this case anyway - I'm still
getting the same error in Mapnik. Just to be clear - I'm able to read and
write spatial data to this SQL Server table using OGR2OGR, which is why I
thought it might be mapnik issue (however, I'm certainly no expert with OGR
either!)

 

Anyway - I'll continue experimenting. And thanks for your help!

_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

Reply via email to