[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [udig-devel] working with gml
|
Thanks, that worked. I'm almost done with the functionallity. I can get the gml and wkt geometries from the map with an IOp and write the text to a text area field and I'm halfway on doing the reverse operation.
I can create the scratch layer with
createTemporaryResource. I parse gml / wkt into a Geometry and add it to the scratch 'layer'. However I couldn't figure out how to add the scratch layer to the current map (I can do it from uDig but not from code).
On Tue, Feb 15, 2011 at 11:14 PM, Jody Garnett
<jody.garnett@xxxxxxxxx> wrote:
This page has something:
The following ICatalog methods are used when working with a local catalog
-
createTemporaryResource( Object ) - used to create a temporary resources, usually by using a FeatureType
- getTemporaryDescriptorClasses() - list of classes for which a temporary resource can be created
I did not see a code example.
My understanding is you can pass a feature type into createTemporaryResource.
--
Jody Garnett
On Wednesday, 16 February 2011 at 1:22 AM, Jaime Lop wrote:
The scratch layer seems to be the perfect solution for me, but I can't figure out how to create one programmatically. I've looked into the udig developers confluence but I'm a bit lost.
On Fri, Feb 11, 2011 at 4:34 AM, Jody Garnett
<jody.garnett@xxxxxxxxx> wrote:
Depends how you want to do it; there is a facility to create a scratch layer (so you could place your GML or WKT on screen quickly - and then leave it up to the user if they want to save it to a shapefile or not).
You could also look at "paste" from walkthrough 2; it will take features copied form another layer and try and use them to create features in the currently selected layer.
You may even just be able to hack at that code so that if the clipboard contents is text that parses with WKT it is used as is?
Talk to Jesse for more details.
--
Jody Garnett
Sent with Sparrow
On Wednesday, 9 February 2011 at 6:06 PM, Jaime Lop wrote:
Thanks for your help. I was able to get the geometry and copy the kwt or gml. Now I have to figure out how to do the reverse: from a text field (wkt or gml) show a geometry on a map. I guess I'll need to create a shape or something and put it on a new layer?
Jaime
On Tue, Feb 8, 2011 at 11:20 PM, Jody Garnett
<jody.garnett@xxxxxxxxx> wrote:
WKT is a suitable format; at one point you could "copy" a geometry to the clipboard; and "paste" it into your text document as WKT.
There is a preference page setting with respect to that.
Jody
On 08/02/2011, at 7:46 PM, Jaime Lop wrote:
When I have a geometry selected I only have the "Make Hole" and "Count" operations.
It's a good idea to use the workbench selection tutorial as an starting point. In fact I don't think I really need to get the gml, any format would be good for me.
Let's say I have a MultiPolygon. Is it WKT format the one I get from the toString method? I guess there is a better way to retrieve this than the method toString (??).
Jaime
On Tue, Feb 8, 2011 at 9:48 AM, Jody Garnett
<jody.garnett@xxxxxxxxx> wrote:
Thinking.
For a geometry operation to work you may need to select the geometry with the edit tool.
You could also try an operation of a feature; or a feature collection.
Hey wait - you tried out the workbench selection tutorial. You can use that to sort out what is selected with the different tools and make your operation against that.
If that does not work we probably have a bug to look into :-P
Jody
On 08/02/2011, at 6:15 PM, Jaime Lop wrote:
Thanks for the quick response.
I've done the workbench and the distance tool tutorials and I think I have a good understanding now of how it works. However I cannot make the operation works.
I crearte my extension like this:
<extension
point="net.refractions.udig.ui.operation">
<operation
categoryId="net.refractions.udig.project.ui.informationOperations"
class="com.example.GetGML"
enablesFor="1"
id="com.example.getGML"
name="GetGML"
targetClass="org.opengis.geometry.Geometry">
<enablement></enablement>
</operation>
</extension>
Is org.opengis.geometry.Geometry the good targetClass? Should I see an entry in the contextual map menu or in the main menu?
I'm using AIXM 5.1 which extends gml 3.2 but I was trying to do it first with an example gml file (xml+xsd).
Jaime
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.nethttp://lists.refractions.net/mailman/listinfo/udig-devel
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.nethttp://lists.refractions.net/mailman/listinfo/udig-devel
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel