[OSM-dev] Osmosis Command Line Improvements

Brett Henderson brett at bretth.com
Tue Nov 27 11:51:19 GMT 2007


Robert (Jamie) Munro wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Brett Henderson wrote:
>   
>> Shaun McDonald wrote:
>>     
>>> Please remember that Apple hasn't released JDK1.6 for Mac OS X 10.5 
>>> Leopard yet.
>>> [..]
>>>
>>> Shaun
>>>       
>> Then don't use an alternative proprietary OS ;-)  Why don't they support 
>> it, it's hardly new?  Is it far away?
>>
>> Sorry, that wasn't helpful :-)
>>
>> Osmosis has required 1.6 for a while now and so far everybody has been 
>> able to download the appropriate JDK1.6 from Sun.  Presumably that's not 
>> an option on OS X.  It should be possible to run on 1.5 if you delete 
>> the polygon task and factory, update the TaskRegistrar class to remove 
>> the reference to it and recompile.  I haven't tested this for a while so 
>> I can't guarantee that no other JDK1.6'isms haven't slipped in.  I can 
>> provide assistance if required.  I'm extremely hesitant to maintain two 
>> versions of osmosis to support a very limited audience but may be 
>> persuaded if enough noise is made.
>>     
>
> I'd certainly like osmosis to work on Mac OS. I wonder if there is an
> alternative solution, something like providing a dummy polygon class
> that lets it compile on JDK 1.5, but just throws an exception. Then you
> hopefully wouldn't need much difference between the two versions. If you
> tried a polygon extract on Java 1.5, you would just get that exception,
> which could be handled nicely.
>   
Yep, that would work.  I don't have a java 1.5 environment available at 
the moment so I may not get to this before I go on leave ...

Do you have a 1.5 jdk and "ant" installed?  If so, I think the only 
class that needs modifying is 
com.bretth.osmosis.core.filter.common.PolygonFileReader
It should be sufficient to modify the private Area 
loadSectionPolygon(BufferedReader bufferedReader) method, remove all 
existing code and add something like.
throw new OsmosisRuntimeException("Polygon extraction is not supported 
on Java 1.5.");






More information about the dev mailing list