|
From: Jody G. <jga...@re...> - 2006-10-04 20:51:30
|
Jesse Eichar wrote:
> 2.4 release is more realistic unless someone else can offer me the
> patch. I am far too busy to do anything beyond bug fixes and applying
> patches at this point.
Here is a patch - HONGSUNG LEE if you create a Jira issue to track this
problem (and attach this patch to it) we should be doing okay.
> /**
> * This method is used to force the creation of a .prj file.
> * <p>
> * The internally cached FeatureType will be removed, so the next
> call to
> * getSchema() will read in the created file. This method is not
> thread safe
> * and will have dire consequences for any other thread making use
> of the
> * shapefile.
> * <p>
> * @param crs
> */
> public void forceSchemaCRS( CoordinateReferenceSystem crs ) throws
> IOException {
> if( crs == null ) throw new NullPointerException("CRS required
> for .prj file");
>
> long temp = System.currentTimeMillis();
>
> String s = crs.toWKT();
> FileWriter out = new FileWriter(getStorageFile(prjURL, temp));
>
> try {
> out.write(s);
> } finally {
> out.close();
> }
> copyAndDelete(prjURL, temp);
> schema = null;
> }
>
> Jesse
>
> On 4-Oct-06, at 12:29 PM, JONGSUNG LEE wrote:
>
>> Thank you.
>>
>> So, is there any plan to add this functionality in 2.3 release?
>>
>> - Jong
>>
>> ----- Original Message ----
>> From: Jesse Eichar <je...@re...>
>> To: Jody Garnett <jga...@re...>
>> Cc: JONGSUNG LEE <jon...@ya...>;
>> geo...@li...
>> Sent: Tuesday, October 3, 2006 10:11:46 PM
>> Subject: Re: [Geotools-gt2-users] how to define the projection for
>> shp file (no prj)
>>
>> Currently there isn't a way to do this. The only thing you could do
>> is generate a .prj file and the re-create the shapefile datastore.
>>
>> Jesse
>>
>> On 3-Oct-06, at 3:33 PM, Jody Garnett wrote:
>>
>>> JONGSUNG LEE wrote:
>>>> Hi,
>>>>
>>>> I load a shapefile which doesn't have a prj file. But, we know
>>>> that it is in WGS84. How can I define the projection after I
>>>> loaded the shapfile into a datastore?
>>>>
>>> Not sure you can (you need to ask Jesse here who is the module
>>> maintainer).
>>> I suspect you need to write out a prj file, although I am not sure
>>> if it will just be picked up or if you will need to reload.
>>>
>>> Jody
>>
>>
>>
>>
>
|