Hi Larry,

Works fine, this patch will be much appreciated !

Thanks,

Michaël

Le 01/04/2011 06:03, Larry Reeder a écrit :
> Thanks ede,  It took a while to work through some problems with my
> sourceforge login, but the patch is commited as revision 2243.  I'll
> verify the fix in the nightly builds.
>
>      -lreeder
>
> On Wed, Mar 30, 2011 at 6:34 AM,<edgar.sol...@web.de>  wrote:
>> looks sensible to me. please suit yourself. i just added your lreeder sf.net 
>> account to the svn. if anybody does not agree to give larry svn acces, 
>> please speak up now.
>>
>> @larry&  all: could somebody please also verify the nightly build for the 
>> correctness of that change?
>>
>> thanks alot... ede
>>
>>
>> On 30.03.2011 06:19, Larry Reeder wrote:
>>> I've got a patch that allows direct selection of a PostGis geometry
>>> column without needing to use ST_AsBinary() to get past that "unknown
>>> WKB type 48" error.  The patch also supports continued use of
>>> ST_AsBinary.   Can someone commit the patch for me or give me write
>>> access to the repository?
>>>
>>> Thanks.............                lreeder
>>>
>>> Patch below:
>>>
>>> Index: datastore/postgis/PostgisValueConverterFactory.java
>>> ===================================================================
>>> --- datastore/postgis/PostgisValueConverterFactory.java       (revision 
>>> 2241)
>>> +++ datastore/postgis/PostgisValueConverterFactory.java       (working copy)
>>> @@ -69,8 +69,36 @@
>>>           throws IOException, SQLException, ParseException
>>>       {
>>>         byte[] bytes = rs.getBytes(columnIndex);
>>> -      if (bytes == null) return wktReader.read("GEOMETRYCOLLECTION EMPTY");
>>> -      else return wkbReader.read(bytes);
>>> +
>>> +      //so rs.getBytes will be one of two things:
>>> +      //1. The actual bytes of the WKB if someone did ST_AsBinary
>>> +      //2. The bytes of hex representation of the WKB.
>>> +
>>> +      //in the case of #1, according to the WKB spec, the byte value
>>> +      //can only be 0 or 1.
>>> +      //in the case of #2, it's a hex string, so values range from ascii 
>>> 0-F
>>> +      //use this logic to determine how to process the bytes.
>>> +
>>> +      Geometry geometry = null;
>>> +      if(bytes == null || bytes.length<= 0)
>>> +      {
>>> +         geometry = wktReader.read("GEOMETRYCOLLECTION EMPTY");
>>> +      }
>>> +      else
>>> +      {
>>> +          //assume it's the actual bytes (from ST_AsBinary)
>>> +          byte[] realWkbBytes = bytes;
>>> +          if(bytes[0]>= '0')
>>> +          {
>>> +              //ok, it's hex, convert hex string to actual bytes
>>> +              String hexString = new String(bytes);
>>> +              realWkbBytes = WKBReader.hexToBytes(hexString);
>>> +          }
>>> +
>>> +          geometry = wkbReader.read(realWkbBytes);
>>> +      }
>>> +
>>> +      return geometry;
>>>       }
>>>     }
>>>   }
>>>
>>> ------------------------------------------------------------------------------
>>> Enable your software for Intel(R) Active Management Technology to meet the
>>> growing manageability and security demands of your customers. Businesses
>>> are taking advantage of Intel(R) vPro (TM) technology - will your software
>>> be a part of the solution? Download the Intel(R) Manageability Checker
>>> today! http://p.sf.net/sfu/intel-dev2devmar
>>> _______________________________________________
>>> Jump-pilot-devel mailing list
>>> Jump-pilot-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>> ------------------------------------------------------------------------------
>> Enable your software for Intel(R) Active Management Technology to meet the
>> growing manageability and security demands of your customers. Businesses
>> are taking advantage of Intel(R) vPro (TM) technology - will your software
>> be a part of the solution? Download the Intel(R) Manageability Checker
>> today! http://p.sf.net/sfu/intel-dev2devmar
>> _______________________________________________
>> Jump-pilot-devel mailing list
>> Jump-pilot-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>>
> ------------------------------------------------------------------------------
> Create and publish websites with WebMatrix
> Use the most popular FREE web apps or write code yourself;
> WebMatrix provides all the features you need to develop and
> publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
> _______________________________________________
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>
>


------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to