Thank you all for the replies! <br>With a little of job I was able to distinguish and gather the parts of a IFeature.<br>However, now I have to redraw the part with different colors than the single color of the selection tools (yellow).<br>

Can someone help me with this task?<br><br>This is how I retrieve the points/linesegments composing the part of my geometry (which got 4 coordinates per point):<br><br>public static LinkedList&lt;Part&gt; getParts(IFeature feature) {<br>

<br>        LinkedList&lt;Part&gt; parts = new LinkedList&lt;Part&gt;();<br>        ArrayList&lt;LineSegment&gt; lineSegments = new ArrayList&lt;LineSegment&gt;();<br>        PathIterator theIterator;<br>        int theType;<br>

        int numGeometries = 0;<br>        IGeometry g = feature.getGeometry();<br>        // Use this array to store segment coordinate data<br>        double[] theData = new double[6];<br>        ArrayList&lt;Point4D&gt; arrayCoords = new ArrayList&lt;Point4D&gt;();<br>

        Shape internalShape = g.getInternalShape();<br>        double shapeZs[] = null;<br>        double shapeMs[] = null;<br>        //retrieve parts only if line geometries<br>        if (!(internalShape instanceof FPolyline2D) &amp;&amp; !(internalShape instanceof FPolyline3D)<br>

                &amp;&amp; !(internalShape instanceof FPolyline3DM))<br>            return null;<br>        if (internalShape instanceof FPolyline3D) {<br>            shapeZs = ((FPolyline3D) internalShape).getZs();<br>            if (internalShape instanceof FPolyline3DM) {<br>

                shapeMs = ((FPolyline3DM) internalShape).getMs();<br>            }<br>        }<br>        <br>        theIterator = g.getPathIterator(null, FConverter.FLATNESS);<br>        int pointIndex = 0;<br>        while (!theIterator.isDone()) {<br>

            theType = theIterator.currentSegment(theData);<br>            // new part: save current one and create another lineString/curve <br>            if (theType == PathIterator.SEG_MOVETO) {<br>                if (lineSegments.size() &gt; 0) {<br>

                    parts.add(new Part(numGeometries, lineSegments));<br>                    logger.debug(&quot;End of part &quot; + numGeometries);<br>                    lineSegments = new ArrayList&lt;LineSegment&gt;();<br>

                }<br>                numGeometries++;<br>                Point4D currentPoint = createPoint4D(theData, shapeZs, shapeMs, pointIndex);<br>                arrayCoords.add(currentPoint);<br>            }<br>
            // segment of the current lineString/curve<br>
            else if (theType == PathIterator.SEG_LINETO) {<br>                Point4D currentPoint = createPoint4D(theData, shapeZs, shapeMs, pointIndex);<br>                arrayCoords.add(currentPoint);<br>                Point4D prevPoint = arrayCoords.get(arrayCoords.size() - 2);<br>

                Coordinate pCoords = prevPoint.getAsCoordinate();<br>                <br>                LineSegment l = new LineSegment(pCoords, currentPoint.getAsCoordinate());<br>                lineSegments.add(l);<br>

            }<br>            //  polygon/polyline closing the geometry<br>            else if (theType == PathIterator.SEG_CLOSE) {<br>                Point4D firstPoint = arrayCoords.get(0);<br>                Point4D prevPoint = arrayCoords.get(arrayCoords.size() - 1);<br>

                Coordinate pCoords = prevPoint.getAsCoordinate();<br>                LineSegment l = new LineSegment(pCoords, firstPoint.getAsCoordinate());<br>                lineSegments.add(l);<br>                parts.add(new Part(numGeometries, lineSegments));<br>

                logger.debug(&quot;End of part &quot; + numGeometries);<br>                lineSegments = new ArrayList&lt;LineSegment&gt;();<br>            }<br>            theIterator.next();<br>            pointIndex++;<br>

            // if there&#39;s no other point add the last part to the returned ones<br>            if (theType == PathIterator.SEG_LINETO &amp;&amp; theIterator.isDone()) {<br>                parts.add(new Part(numGeometries, lineSegments));<br>

                logger.debug(&quot;End of last geometry&#39;s part &quot; + numGeometries);<br>            }<br>        }<br>        if (logger.isDebugEnabled()) {<br>            logger.debug(&quot;Feature &quot; + feature.getID() + &quot; contains &quot; + numGeometries + &quot; parts&quot;);<br>

        }<br>        return parts;<br>    }<br><br>Best regards,<br>Flavio<br><br><div class="gmail_quote">2010/2/2 Francisco José Peñarrubia <span dir="ltr">&lt;<a href="mailto:fpenarru@gmail.com">fpenarru@gmail.com</a>&gt;</span><br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Flavio.<br>
<br>
You have to options: slow and quick, easy and a bit more difficult.<br>
The easy and slow is to convert your IGeometry to JTS Geometry with<br>
method &quot;toJTS&quot;.<br>
The quick is to use PathIterator. You can see code from extCAD =&gt;<br>
IntersectionPointSnapper. Have a look to method getLineIntersection to<br>
see an example:<br>
<br>
    public ArrayList getLineIntersection(IGeometry g, Coordinate c,<br>
double tol) {<br>
        // return gp.intersects(r);<br>
        // Más exacto<br>
        boolean bool = false;<br>
        ArrayList lineSegments = new ArrayList();<br>
        int theType;<br>
        // Use this array to store segment coordinate data<br>
        double[] theData = new double[6];<br>
        PathIterator theIterator;<br>
<br>
        theIterator = g.getPathIterator(null, FConverter.FLATNESS);<br>
        ArrayList arrayCoords = new ArrayList();<br>
        while (!theIterator.isDone()) {<br>
            theType = theIterator.currentSegment(theData);<br>
            if (theType == PathIterator.SEG_MOVETO) {<br>
                arrayCoords.add(new Point2D.Double(theData[0], theData[1]));<br>
            } else if (theType == PathIterator.SEG_LINETO) {<br>
                arrayCoords.add(new Point2D.Double(theData[0], theData[1]));<br>
                Point2D pAnt = (Point2D) arrayCoords<br>
                        .get(arrayCoords.size() - 2);<br>
                LineSegment l = new LineSegment(pAnt.getX(), pAnt.getY(),<br>
                        theData[0], theData[1]);<br>
                if (l.distancePerpendicular(c) &lt; tol) {<br>
                    bool = true;<br>
                    lineSegments.add(l);<br>
                }<br>
            } else if (theType == PathIterator.SEG_CLOSE) {<br>
                Point2D firstPoint = (Point2D) arrayCoords.get(0);<br>
                Point2D pAnt = (Point2D) arrayCoords<br>
                        .get(arrayCoords.size() - 1);<br>
                LineSegment l = new LineSegment(pAnt.getX(), pAnt.getY(),<br>
                        firstPoint.getX(), firstPoint.getY());<br>
                if (l.distancePerpendicular(c) &lt; tol) {<br>
                    bool = true;<br>
                    lineSegments.add(l);<br>
                }<br>
            }<br>
            theIterator.next();<br>
        }<br>
        return lineSegments;<br>
    }<br>
<br>
Hope this helps.<br>
<br>
Fran Peñarrubia<br>
<a href="http://www.scolab.es" target="_blank">www.scolab.es</a><br>
<br>
Flavio Pompermaier escribió:<br>
<div class="im">&gt; Thank you all for the quick replies,<br>
&gt; but unfortunately I need parts enlighting, also if the multi-part<br>
&gt; geometry is not splitted into many parts.<br>
&gt; I think I&#39;ll implement such a functionality but I don&#39;t know where to<br>
&gt; start..could someone give me some hint and<br>
&gt; save me some work...??<br>
&gt;<br>
&gt; Thanks in advance,<br>
&gt; Flavio<br>
&gt;<br>
&gt; 2010/2/1 Simon Cropper (Botanicus Australia Pty Ltd)<br>
&gt; &lt;<a href="mailto:scropper@botanicusaustralia.com.au">scropper@botanicusaustralia.com.au</a><br>
</div><div><div></div><div class="h5">&gt; &lt;mailto:<a href="mailto:scropper@botanicusaustralia.com.au">scropper@botanicusaustralia.com.au</a>&gt;&gt;<br>
&gt;<br>
&gt;     Flavio,<br>
&gt;<br>
&gt;     gvSIG does not have the ability to split multi-part polygons so<br>
&gt;     each of<br>
&gt;     the &quot;parts&quot; can be manipulated seprately.<br>
&gt;<br>
&gt;     The Sextante 0.5 Plug-in has a routine though called &quot;Separate<br>
&gt;     multi-part features&quot; under the menu &quot;Tools for Cector layers&quot;.<br>
&gt;<br>
&gt;     This creates a new file where any multi-part polygon is split into its<br>
&gt;     component parts.<br>
&gt;<br>
&gt;     If you do not have Sextante 0.5 running you can find the instructions<br>
&gt;     for installation here...<br>
&gt;     <a href="https://gvsig.org/web/projects/contrib/community-doc/pub/test-docs/getting-sextante-0-5-to-work-with-gvsig-version-1-9-bn-1253/" target="_blank">https://gvsig.org/web/projects/contrib/community-doc/pub/test-docs/getting-sextante-0-5-to-work-with-gvsig-version-1-9-bn-1253/</a><br>


&gt;<br>
&gt;     Cheers Simon<br>
&gt;<br>
&gt;     Simon Cropper<br>
&gt;     Botanicus Australia Pty Ltd<br>
&gt;     PO Box 160, Sunshine, Victoria 3020.<br>
&gt;     P: 9311 5822. M: 041 830 3437.<br>
&gt;     mailto: <a href="mailto:scropper@botanicusaustralia.com.au">scropper@botanicusaustralia.com.au</a><br>
&gt;     &lt;mailto:<a href="mailto:scropper@botanicusaustralia.com.au">scropper@botanicusaustralia.com.au</a>&gt;<br>
&gt;     &lt;mailto:<a href="mailto:scropper@botanicusaustralia.com.au">scropper@botanicusaustralia.com.au</a><br>
&gt;     &lt;mailto:<a href="mailto:scropper@botanicusaustralia.com.au">scropper@botanicusaustralia.com.au</a>&gt;&gt;<br>
&gt;     web: <a href="http://www.botanicusaustralia.com.au" target="_blank">www.botanicusaustralia.com.au</a><br>
&gt;     &lt;<a href="http://www.botanicusaustralia.com.au" target="_blank">http://www.botanicusaustralia.com.au</a>&gt;<br>
&gt;     &lt;<a href="http://www.botanicusaustralia.com.au" target="_blank">http://www.botanicusaustralia.com.au</a>&gt;<br>
&gt;<br>
&gt;<br>
&gt;     On 2/02/2010 3:13 AM, Flavio Pompermaier wrote:<br>
&gt;     &gt; Hi to all,<br>
&gt;     &gt; I&#39;d like to know if anybody has ever encountered the problem I<br>
&gt;     have to<br>
&gt;     &gt; face with: I&#39;ve multipart geometries on which I must do some work on<br>
&gt;     &gt; theri single parts,<br>
&gt;     &gt; like reordering, enlighting, union, splitting and similar stuff.<br>
&gt;     Does<br>
&gt;     &gt; gvSIG have the knowledge of &quot;parts&quot; concept from an editing<br>
&gt;     point of view?<br>
&gt;     &gt; Could it be introduced without a great effort? And if so, where<br>
&gt;     should<br>
&gt;     &gt; I start from with the code?<br>
&gt;     &gt;<br>
&gt;     &gt; Any help is appreciated!<br>
&gt;     &gt; Flavio<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt; _______________________________________________<br>
&gt;     &gt; Gvsig_internacional mailing list<br>
&gt;     &gt; <a href="mailto:Gvsig_internacional@listserv.gva.es">Gvsig_internacional@listserv.gva.es</a><br>
</div></div>&gt;     &lt;mailto:<a href="mailto:Gvsig_internacional@listserv.gva.es">Gvsig_internacional@listserv.gva.es</a>&gt;<br>
<div class="im">&gt;     &gt; <a href="http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional" target="_blank">http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional</a><br>
&gt;     &gt;<br>
&gt;     _______________________________________________<br>
&gt;     Gvsig_internacional mailing list<br>
&gt;     <a href="mailto:Gvsig_internacional@listserv.gva.es">Gvsig_internacional@listserv.gva.es</a><br>
</div>&gt;     &lt;mailto:<a href="mailto:Gvsig_internacional@listserv.gva.es">Gvsig_internacional@listserv.gva.es</a>&gt;<br>
<div><div></div><div class="h5">&gt;     <a href="http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional" target="_blank">http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional</a><br>
&gt;<br>
&gt;<br>
&gt; ------------------------------------------------------------------------<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Gvsig_internacional mailing list<br>
&gt; <a href="mailto:Gvsig_internacional@listserv.gva.es">Gvsig_internacional@listserv.gva.es</a><br>
&gt; <a href="http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional" target="_blank">http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional</a><br>
&gt;<br>
<br>
_______________________________________________<br>
Gvsig_internacional mailing list<br>
<a href="mailto:Gvsig_internacional@listserv.gva.es">Gvsig_internacional@listserv.gva.es</a><br>
<a href="http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional" target="_blank">http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional</a><br>
</div></div></blockquote></div><br>