[mapserver-users] MapServer and Guid USING UNIQUE
Roger Bedell
sylvanascent at gmail.com
Fri Mar 18 03:41:44 PDT 2011
Hi Tamas,
Ok, well thanks so much for trying! I wonder if we could create unique
integer ID with a view - I have no idea if that is possible.
Roger
On Fri, Mar 18, 2011 at 11:09 AM, Tamas Szekeres <szekerest at gmail.com>wrote:
> Hi Roger,
>
> I came into the conclusion that supporting the uniqueidentifier is not
> possible with MapServer because the feature index is stored as int and we
> cannot convert the guid value to int.
> I'll revert the code to the original behaviour so MapServer will provide an
> error if the uniqueidentifier is used. For a workaround we could probably
> create an additional column with identity int or try to use checksum(PKey)
> instead of PKey in the layer configuration.
>
> Best regards,
>
> Tamas
>
>
>
>
> 2011/3/18 Roger Bedell <sylvanascent at gmail.com>
>
>> Hi Tamas,
>> Try this, the UNIQUE is currently oid in the MAP file, and it should work.
>> Change to PKey, and it should bomb.
>> Roger
>>
>>
>> On Thu, Mar 17, 2011 at 11:31 PM, Tamas Szekeres <szekerest at gmail.com>wrote:
>>
>>> Hmmm. Just tried this and it works for me. Do you have a data/mapfile
>>> example to reproduce the problem?
>>>
>>>
>>> Best regards,
>>>
>>> Tamas
>>>
>>>
>>>
>>> 2011/3/17 Roger Bedell <sylvanascent at gmail.com>
>>>
>>>> Hi Tamas,
>>>>
>>>> I get this:
>>>>
>>>> "Attempted to read or write protected memory. This is often an
>>>> indication that other memory is corrupt." when trying to use the
>>>> UniqueIdentifier field as Unique. Same thing works fine using an integer
>>>> field as Unique.
>>>>
>>>> Roger
>>>>
>>>>
>>>> On Thu, Mar 17, 2011 at 9:19 PM, Roger Bedell <sylvanascent at gmail.com>wrote:
>>>>
>>>>> Sorry about that, I understand now. Development is trunk, -stable is
>>>>> fixes to the official release. I do this all the time with GeoServer, so one
>>>>> would think I'd learn.[?]
>>>>>
>>>>> Roger
>>>>>
>>>>>
>>>>> On Thu, Mar 17, 2011 at 9:08 PM, Tamas Szekeres <szekerest at gmail.com>wrote:
>>>>>
>>>>>> Hi Roger,
>>>>>>
>>>>>> The package you mention contains the latest "official" release
>>>>>> versions of MapServer and GDAL which has been released earlier and doesn't
>>>>>> contain the fix, you should use the -stable branch versions instead.
>>>>>>
>>>>>>
>>>>>> Best regards,
>>>>>>
>>>>>> Tamas
>>>>>>
>>>>>>
>>>>>>
>>>>>> 2011/3/17 Roger Bedell <sylvanascent at gmail.com>
>>>>>>
>>>>>>> Hi Tamas. I appreciate your help. I tried this one:
>>>>>>>
>>>>>>>
>>>>>>> http://vbkto.dyndns.org/sdk/Download.aspx?file=release-1600-gdal-1-8-0-mapserver-5-6-6.zip
>>>>>>>
>>>>>>> It seemed to me to be the latest stable. It works fine, except the
>>>>>>> fix for Guid doesn't seem to be in there.
>>>>>>>
>>>>>>> Roger
>>>>>>>
>>>>>>>
>>>>>>> On Thu, Mar 17, 2011 at 5:16 PM, Tamas Szekeres <szekerest at gmail.com
>>>>>>> > wrote:
>>>>>>>
>>>>>>>> Roger,
>>>>>>>>
>>>>>>>> Which package did you try. The -stable branches (ie:
>>>>>>>> http://vbkto.dyndns.org/sdk/PackageList.aspx?file=release-1600-gdal-1-8-mapserver-5-6.zip)
>>>>>>>> should contain the fix.
>>>>>>>>
>>>>>>>> Best regards,
>>>>>>>>
>>>>>>>> Tamas
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> 2011/3/17 Roger Bedell <sylvanascent at gmail.com>
>>>>>>>>
>>>>>>>>> Hi Tamas,
>>>>>>>>> I'm trying to get this working and ran into a couple snags. We are
>>>>>>>>> currently using mapscript_csharp.dll version 5.6.5 in a .NET program.
>>>>>>>>>
>>>>>>>>> 1) Tried to just copy just the msplugin_mssql2008.dll from your
>>>>>>>>> latest build from http://vbkto.dyndns.org/sdk/ - this didn't work,
>>>>>>>>> must have other dependencies, I didn't really think it would work.
>>>>>>>>>
>>>>>>>>> 2) Tried to use the latest build. Strangely, mapscript_csharp.dll
>>>>>>>>> doesn't seem to have the same objects as 5.6.5, and I got a bunch of
>>>>>>>>> unresolved references in the code.
>>>>>>>>>
>>>>>>>>> What do you think is the easiest way to get this working?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>> Roger Bedell
>>>>>>>>> Coordinate Solutions Inc.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Thu, Mar 10, 2011 at 12:56 PM, Tamas Szekeres <
>>>>>>>>> szekerest at gmail.com> wrote:
>>>>>>>>>
>>>>>>>>>> Hi Roger,
>>>>>>>>>>
>>>>>>>>>> Could you create a ticket with this issue (
>>>>>>>>>> http://trac.osgeo.org/mapserver/newticket)? I'll take care of
>>>>>>>>>> fixing this.
>>>>>>>>>>
>>>>>>>>>> Best regards,
>>>>>>>>>>
>>>>>>>>>> Tamas
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> 2011/3/10 Roger Bedell <sylvanascent at gmail.com>
>>>>>>>>>>
>>>>>>>>>>> Thanks Till, however, here is the trace from the ODBC tracer,
>>>>>>>>>>> pretty obvious what is going on:
>>>>>>>>>>>
>>>>>>>>>>> DIAG [42000] [Microsoft][ODBC SQL Server Driver][SQL
>>>>>>>>>>> Server]Insufficient result space to convert uniqueidentifier value to char.
>>>>>>>>>>> (8170)
>>>>>>>>>>>
>>>>>>>>>>> Guids generally take up 36 characters when converted to a string,
>>>>>>>>>>> and the Select statement only has room for 20.
>>>>>>>>>>>
>>>>>>>>>>> Since this is a SQL specific query, my guess it is being
>>>>>>>>>>> generated in the sql spatial driver?
>>>>>>>>>>>
>>>>>>>>>>> Roger
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> HSTMT 0x0589B310
>>>>>>>>>>> UCHAR * 0x05E1A990 [ -3] "SELECT
>>>>>>>>>>> Feature.STAsBinary(),convert(varchar(20), PKey) from MetesAndBoundsHeader
>>>>>>>>>>> WHERE Feature.STIntersects(Geometry::STGeomFromText('POLYGON((-104.18599
>>>>>>>>>>> 29.2473266843318,-93.22438 29.2473266843318,-93.22438
>>>>>>>>>>> 41.3707663156682,-104.18599 41.3707663156682,-104.18599
>>>>>>>>>>> 29.2473266843318))',4326)) = 1 \ 0"
>>>>>>>>>>> SDWORD -3
>>>>>>>>>>>
>>>>>>>>>>> DIAG [42000] [Microsoft][ODBC SQL Server Driver][SQL
>>>>>>>>>>> Server]Insufficient result space to convert uniqueidentifier value to char.
>>>>>>>>>>> (8170)
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On Thu, Mar 10, 2011 at 12:04 PM, adams <adams at terrestris.de>wrote:
>>>>>>>>>>>
>>>>>>>>>>>> Dear Roger,
>>>>>>>>>>>>
>>>>>>>>>>>> if you get an empty image with no error, the first try would be
>>>>>>>>>>>> to use a simple symbol and no expression in your layer.
>>>>>>>>>>>> Also ensure, that your extent when querying the map is correct.
>>>>>>>>>>>>
>>>>>>>>>>>> So you make sure, that everything around your datasource is OK.
>>>>>>>>>>>>
>>>>>>>>>>>> Then use a datastring like this one:
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> DATA "the_geom from (SELECT Feature from MetesAndBoundsHeader)
>>>>>>>>>>>> as foo USING UNIQUE PKey USING SRID=4326"
>>>>>>>>>>>>
>>>>>>>>>>>> or however the geometry-column in mssql server is called ;-)
>>>>>>>>>>>>
>>>>>>>>>>>> Regards, Till
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Roger Bedell wrote:
>>>>>>>>>>>>
>>>>>>>>>>>> Good Morning.
>>>>>>>>>>>> I am currently working with MapServer and the MSSQL Spatial
>>>>>>>>>>>> driver. I am seeing that MS does not work with a DATA statement like this in
>>>>>>>>>>>> the Map file:
>>>>>>>>>>>>
>>>>>>>>>>>> DATA "Feature from MetesAndBoundsHeader USING UNIQUE PKey USING
>>>>>>>>>>>> SRID=4326"
>>>>>>>>>>>>
>>>>>>>>>>>> where PKey is defined like this:
>>>>>>>>>>>>
>>>>>>>>>>>> [PKey] [uniqueidentifier] DEFAULT NEWSEQUENTIALID() ROWGUIDCOL
>>>>>>>>>>>> NOT NULL,
>>>>>>>>>>>>
>>>>>>>>>>>> No errors are triggered, however nothing is displayed, including
>>>>>>>>>>>> all other layers. Is this an issue with the SQL Spatial driver or MapServer?
>>>>>>>>>>>> Any ideas on how to fix it?
>>>>>>>>>>>>
>>>>>>>>>>>> Thanks!
>>>>>>>>>>>> Roger Bedell
>>>>>>>>>>>> Coordinate Solutions Inc.
>>>>>>>>>>>>
>>>>>>>>>>>> ------------------------------
>>>>>>>>>>>>
>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>> mapserver-users mailing listmapserver-users at lists.osgeo.orghttp://lists.osgeo.org/mailman/listinfo/mapserver-users
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> --
>>>>>>>>>>>>
>>>>>>>>>>>> ---------------------------------------------------------
>>>>>>>>>>>> terrestris GmbH & Co. KG
>>>>>>>>>>>> Irmintrudisstrasse 17
>>>>>>>>>>>> 53111 Bonn
>>>>>>>>>>>> Germany
>>>>>>>>>>>>
>>>>>>>>>>>> Till Adams
>>>>>>>>>>>> Geschäftsführung
>>>>>>>>>>>>
>>>>>>>>>>>> Tel: <%2B49%20%280%29228%20%2F%20962%20899-52> <%2B49%20%280%29228%20%2F%20962%20899-52> <%2B49%20%280%29228%20%2F%20962%20899-52>+49 (0)228 / 962 899-52
>>>>>>>>>>>> Fax: <%2B49%20%280%29228%20%2F%20962%20899-57> <%2B49%20%280%29228%20%2F%20962%20899-57> <%2B49%20%280%29228%20%2F%20962%20899-57>+49 (0)228 / 962 899-57adams at terrestris.de http://www.terrestris.de
>>>>>>>>>>>> Amtsgericht Bonn, HRA 6835
>>>>>>>>>>>> ---------------------------------------------------------
>>>>>>>>>>>>
>>>>>>>>>>>> Komplementärin:
>>>>>>>>>>>>
>>>>>>>>>>>> terrestris Verwaltungs GmbH
>>>>>>>>>>>>
>>>>>>>>>>>> vertreten durch:
>>>>>>>>>>>> Hinrich Paulsen, Till Adams
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> _______________________________________________
>>>>>>>>>>> mapserver-users mailing list
>>>>>>>>>>> mapserver-users at lists.osgeo.org
>>>>>>>>>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20110318/f4a71d8a/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 330.gif
Type: image/gif
Size: 96 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20110318/f4a71d8a/attachment.gif>
More information about the MapServer-users
mailing list