[postgis-users] Reasonable Way to Convert MULTIPOINT to POINT?

Martin Davis mbdavis at VividSolutions.com
Thu Feb 24 11:37:02 PST 2005


Thanks, Dave.

Not sure why you didn't find getGeometryN and getNumGeometries on
Geometry - this was done in JTS 1.6

Of the others, some of them deal with structure specific to a given
Geometry type.  I can an argument for having isRing and isClosed at the
top level.

Martin Davis, Senior Technical Architect
Vivid Solutions Inc.      www.vividsolutions.com
Suite #1A-2328 Government Street Victoria, B.C. V8T 5G5
Phone: (250) 385 6040 - Local 308 Fax: (250) 385 6046


> -----Original Message-----
> From: dblasby at openplans.org [mailto:dblasby at openplans.org] 
> Sent: February 24, 2005 11:16 AM
> To: postgis-devel at postgis.refractions.net
> Cc: postgis-users at postgis.refractions.net
> Subject: Re: [postgis-users] Reasonable Way to Convert 
> MULTIPOINT to POINT?
> 
> 
> Martin Davis wrote:
> 
> >Generally, a clear pattern that has emerged from using the 
> SFS API is 
> >that methods should be supported by ALL Geometry types if at all 
> >possible, using reasonable default return values if necessary. 
> >PostGIS/GEOS might want to consider providing similar methods.
> 
> Martin,
> 
> When I autogenerated the StaticGeometry class for Spatial DB 
> in a Box, these are the functions that it found that are not 
> at the "top level":
> 
> 
>      static public int getNumGeometries(Geometry arg0)
>      {
>            GeometryCollection _this = (GeometryCollection) arg0;
> 
>            return _this.getNumGeometries();
>      }
> 
>      static public Geometry getGeometryN(Geometry arg0,int arg1)
>      {
>            GeometryCollection _this = (GeometryCollection) arg0;
> 
>            return _this.getGeometryN(arg1);
>      }
> 
>      static public double getX(Geometry arg0)
>      {
>            Point _this = (Point) arg0;
> 
>            return _this.getX();
>      }
> 
>      static public double getY(Geometry arg0)
>      {
>            Point _this = (Point) arg0;
> 
>            return _this.getY();
>      }
> 
>      static public boolean isClosed(Geometry arg0)
>      {
>            LineString _this = (LineString) arg0;
> 
>            return _this.isClosed();
>      }
> 
>      static public Geometry getPointN(Geometry arg0,int arg1)
>      {
>            LineString _this = (LineString) arg0;
> 
>            return _this.getPointN(arg1);
>      }
> 
>      static public Geometry getStartPoint(Geometry arg0)
>      {
>            LineString _this = (LineString) arg0;
> 
>            return _this.getStartPoint();
>      }
> 
>      static public Geometry getEndPoint(Geometry arg0)
>      {
>            LineString _this = (LineString) arg0;
> 
>            return _this.getEndPoint();
>      }
> 
>      static public boolean isRing(Geometry arg0)
>      {
>            LineString _this = (LineString) arg0;
> 
>            return _this.isRing();
>      }
> 
>      static public Geometry getExteriorRing(Geometry arg0)
>      {
>            Polygon _this = (Polygon) arg0;
> 
>            return _this.getExteriorRing();
>      }
> 
>      static public int getNumInteriorRing(Geometry arg0)
>      {
>            Polygon _this = (Polygon) arg0;
> 
>            return _this.getNumInteriorRing();
>      }
> 
>      static public Geometry getInteriorRingN(Geometry arg0,int arg1)
>      {
>            Polygon _this = (Polygon) arg0;
> 
>            return _this.getInteriorRingN(arg1);
>      }
> 
> dave
> 
> 
> 
> 
> ----------------------------------------------------------
> This mail sent through IMP: https://webmail.limegroup.com/ 
> _______________________________________________
> postgis-users mailing list postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 



More information about the postgis-users mailing list