[mapserver-dev] Possible to use PostGIS as a TILEINDEX to shapefiles?

Brent Fraser bfraser at geoanalytic.com
Thu Apr 28 10:34:28 EDT 2011


Daniel,

   Using OGR results in tlp->connectiontype==MS_OGR and fails as well.

   The main problem (I think) is that the code after line 1901 in 
mapshape.c does a call to msDBFGetItemIndex in preparation for getting 
the value stored in the "location" column.  It needs to be replaced with 
the code from mapraster.c, line 468:

     /* get the tileitem index */
     for(i=0; i<tlp->numitems; i++) {
       if(strcasecmp(tlp->items[i], layer->tileitem) == 0) {
         tileitemindex = i;
         break;
       }
     }

and there could be a few other changes as well.  I'll have to do some 
hacking...

Best Regards,
Brent Fraser


On 4/27/2011 9:02 PM, Daniel Morissette wrote:
> Unfortunately too late for 6.0 as you had already figured out. However 
> you could use OGR connections for your PostGIS tileindex and to read 
> your shapefiles with the current version.
>
> Daniel
>
>
> On 11-04-27 08:42 PM, Brent Fraser wrote:
>> I've used a PostGIS layer as a TILEINDEX to raster files, but it doesn't
>> seem to work for pointing to shapefiles.
>>
>> And looking at mapshape.c at line 1901 it checks:
>>
>> tlp = (GET_LAYER(layer->map, tSHP->tilelayerindex));
>>
>> if(tlp->connectiontype != MS_SHAPEFILE) {
>> msSetError(MS_SDEERR, "Tileindex layer must be a shapefile.",
>> "msTiledSHPOpenFile()");
>> return(MS_FAILURE);
>> }
>>
>>
>> mapraster.c has some logic around line 410 that seems more generic.
>>
>> I wonder if it would be possible to fix this for 6.0, or is it too late
>> now that rc1 is out?
>>
>
>



More information about the mapserver-dev mailing list