[fdo-users] Error in OSGeo.SHP.3.2

Dan Stoica dan.stoica at autodesk.com
Mon Jan 28 15:19:55 EST 2008


Good point. Chris, what type is your column in the database? Is it GEOMETRY or something else?

Dan.

-----Original Message-----
From: fdo-users-bounces at lists.osgeo.org [mailto:fdo-users-bounces at lists.osgeo.org] On Behalf Of Gavin Cramer
Sent: Monday, January 28, 2008 3:05 PM
To: FDO Users Mail List
Subject: RE: [fdo-users] Error in OSGeo.SHP.3.2

Yes.  You can use a column type name of any of the geometry types that MySQL supports, not just GEOMETRY.  The full list is on http://dev.mysql.com/doc/refman/5.0/en/mysql-spatial-datatypes.html .  There is a quick example with POINT on http://dev.mysql.com/doc/refman/5.0/en/creating-spatial-columns.html .

FDO MySQL Provider will pick this up.  For anyone reading the code: this happens in the FdoSmPhMySqlColTypeMapper class.

Gavin



-----Original Message-----
From: fdo-users-bounces at lists.osgeo.org [mailto:fdo-users-bounces at lists.osgeo.org] On Behalf Of Chris Erickson
Sent: Monday, January 28, 2008 2:51 PM
To: 'FDO Users Mail List'
Subject: RE: [fdo-users] Error in OSGeo.SHP.3.2

I know this is not technically FDO then, but is there a way to modify the
geometry column after creation to restrict the types that are allowed?

-Chris

-----Original Message-----
From: fdo-users-bounces at lists.osgeo.org
[mailto:fdo-users-bounces at lists.osgeo.org] On Behalf Of Dan Stoica
Sent: Monday, January 28, 2008 12:47 PM
To: FDO Users Mail List
Subject: RE: [fdo-users] Error in OSGeo.SHP.3.2

As you guessed, MySql allows you store various geometry types into the same
column. Given an existing (ie. Non-FDO) datastore, I'm afraid there is no
way to know exactly what a geometry column contains in terms of type.

And yes, if you create a FDO datastore and use SetGeometryTypes() on a
geometry column at apply schema time, the choice (Point, Line etc.) will be
stored in the metadata and the geometry type will be enforced at insert
time.

Dan.

-----Original Message-----
From: fdo-users-bounces at lists.osgeo.org
[mailto:fdo-users-bounces at lists.osgeo.org] On Behalf Of Chris Erickson
Sent: Monday, January 28, 2008 2:28 PM
To: 'FDO Users Mail List'
Subject: RE: [fdo-users] Error in OSGeo.SHP.3.2

Dan,
Sorry, I'll just explain my whole scenario.

I have a MySql 5.0 instance set up and I imported a plain counties polygon
shapefile.  I'm trying to query the database to find out what kind of
features that table stores (via. FDO), and it is returning a 7 (which
apparently indicates that it stores Point, Line or Polygon).

Is there a way to figure out what type of features that specific layer
stores, or is that 1 layer not 'strongly typed' in MySql?  If not, is there
a way to build layers which only store a specific geometry type in mysql?

-Chris


-----Original Message-----
From: fdo-users-bounces at lists.osgeo.org
[mailto:fdo-users-bounces at lists.osgeo.org] On Behalf Of Dan Stoica
Sent: Monday, January 28, 2008 12:11 PM
To: FDO Users Mail List
Subject: RE: [fdo-users] Error in OSGeo.SHP.3.2

Hi,

" the GeometryTypes member doesn't return the type of geometry"

Do you mean it returns a 0 (zero)?  Did you SetGeometryTypes() on that
class?
What exactly is the scenario?

Thanks,
Dan.

-----Original Message-----
From: fdo-users-bounces at lists.osgeo.org
[mailto:fdo-users-bounces at lists.osgeo.org] On Behalf Of Chris Erickson
Sent: Monday, January 28, 2008 1:44 PM
To: 'FDO Users Mail List'
Subject: RE: [fdo-users] Error in OSGeo.SHP.3.2

I'll do that.

Does anybody have thoughts on my 2nd question?

2) If I have a GeometricPropertyDefinition that belongs to a feature class,
and the GeometryTypes member doesn't return the type of geometry the
property stores, where do I find out this information?

Thanks,
Chris
-----Original Message-----
From: fdo-users-bounces at lists.osgeo.org
[mailto:fdo-users-bounces at lists.osgeo.org] On Behalf Of Greg Boone
Sent: Friday, January 25, 2008 1:35 PM
To: FDO Users Mail List
Subject: RE: [fdo-users] Error in OSGeo.SHP.3.2

Please log a trac item on trac.osgeo.org/fdo.

Greg

-----Original Message-----
From: fdo-users-bounces at lists.osgeo.org
[mailto:fdo-users-bounces at lists.osgeo.org] On Behalf Of Clayton Hotson
Sent: Friday, January 25, 2008 2:49 PM
To: FDO Users Mail List
Subject: RE: [fdo-users] Error in OSGeo.SHP.3.2

Hi Chris,

I've noticed this as well - for some reason this enum is not exposed in the
managed wrappers.

You can define it yourself though - something like:

        public enum GeometricType
        {
            GeometricType_Point = 1,
            GeometricType_Curve = 2,
            GeometricType_Surface = 4,
            GeometricType_Solid = 8,
            GeometricType_All = 1 | 2 | 4 | 8
        }

I hope this helps!

Clayton


-----Original Message-----
From: fdo-users-bounces at lists.osgeo.org
[mailto:fdo-users-bounces at lists.osgeo.org] On Behalf Of Chris Erickson
Sent: Friday, January 25, 2008 4:36 PM
To: 'FDO Users Mail List'
Subject: RE: [fdo-users] Error in OSGeo.SHP.3.2

Traian,
Thanks for the insight. That helps a lot.

A few more questions (for anyone)
1) I'm using the DotNET API, and I can't find the GeometricType enumeration.
Do you know where it is exposed?
2) If I have a GeometricPropertyDefinition that belongs to a feature class,
and the GeometryTypes member doesn't return the type of geometry the
property stores, where do I find out this information?
3) If I use IFeatureReader::GetGeometry(), it returns an FGF binary,
correct?

Thanks for the help,
Chris

-----Original Message-----
From: fdo-users-bounces at lists.osgeo.org
[mailto:fdo-users-bounces at lists.osgeo.org] On Behalf Of Traian Stanev
Sent: Thursday, January 24, 2008 4:36 PM
To: FDO Users Mail List
Subject: RE: [fdo-users] Error in OSGeo.SHP.3.2


Not a bug, but very confusing nonetheless. The GEOMETRIC property type is
one of:

/// \ingroup (enums)
/// \brief
/// The FdoGeometricType enumeration categorizes all of the geometry types
/// supported by FDO based on their geometric dimensionality.
enum FdoGeometricType
{
    /// Represents 0-dimensional geometric primitives, such as Points.
    FdoGeometricType_Point = 0x01,
    /// Represents 1 dimensional geometric primitives, such as Curves and
Lines.
    FdoGeometricType_Curve = 0x02,
    /// Represents 2 dimensional geometric primitives, such as Polygons.
    FdoGeometricType_Surface = 0x04,
    /// Represents 3 dimensional geometric primitives, such as Cubes.
    FdoGeometricType_Solid = 0x08
};

This is not the same as the GEOMETRY type of the actualy geometry returned
by FdoIFeatureReader::GetGeometry(), which is one of:


#ifdef __cplusplus
/// \ingroup (enums)
    /// \brief
    ///  FdoGeometryType is an enumeration to denote the type of a Geometry.
    ///
    /// \remarks
    ///  This enumeration applies to types that derive from FdoIGeometry.
    enum FdoGeometryType
#else
    typedef enum
#endif
{
    /// Indicates no specific type; used for "unknown", "don't care" or an
incompletely constructed Geometry object.
    FdoGeometryType_None = 0,
    /// Point type (FdoIPoint).
    FdoGeometryType_Point = 1,
    /// LineString type (FdoILineString).
    FdoGeometryType_LineString = 2,
    /// Polygon type (FdoIPolygon).
    FdoGeometryType_Polygon = 3,
    /// MultiPoint type (FdoIMultiPoint).
    FdoGeometryType_MultiPoint = 4,
    /// MultiLineString type (FdoIMultiLineString).
    FdoGeometryType_MultiLineString = 5,
    /// MultiPolygon type (FdoIMultiPolygon).
    FdoGeometryType_MultiPolygon = 6,
    /// MultiGeometry type (FdoIMultiGeometry).
    FdoGeometryType_MultiGeometry = 7,
    /// CurveString type (FdoICurveString).
    FdoGeometryType_CurveString = 10,
    /// CurvePolygon type (FdoICurvePolygon).
    FdoGeometryType_CurvePolygon = 11,
    /// MultiCurveString type (FdoIMultiCurveString).
    FdoGeometryType_MultiCurveString = 12,

    /// MultiCurvePolygon type (FdoIMultiCurvePolygon).
    FdoGeometryType_MultiCurvePolygon = 13
#ifdef __cplusplus
};
#else
} FdoGeometryType;
#endif





From: fdo-users-bounces at lists.osgeo.org [fdo-users-bounces at lists.osgeo.org]
On Behalf Of Chris Erickson [chris at spatialdatatech.com]
Sent: Thursday, January 24, 2008 6:15 PM
To: fdo-users at lists.osgeo.org
Subject: [fdo-users] Error in OSGeo.SHP.3.2


Hello,
I'm using FDO 3.2 and connecting to a Polygon shape file of US Counties
(using the DotNet interops).  When I get the geometry property of the
counties feature class, the GeometryTypes member is 4 (MultiPoint).  This
should be 3 (polygon).  Does anybody know why this is happening, or is it
just a bug?

-Chris
_______________________________________________
fdo-users mailing list
fdo-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/fdo-users

_______________________________________________
fdo-users mailing list
fdo-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/fdo-users
_______________________________________________
fdo-users mailing list
fdo-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/fdo-users
_______________________________________________
fdo-users mailing list
fdo-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/fdo-users

_______________________________________________
fdo-users mailing list
fdo-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/fdo-users
_______________________________________________
fdo-users mailing list
fdo-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/fdo-users

_______________________________________________
fdo-users mailing list
fdo-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/fdo-users
_______________________________________________
fdo-users mailing list
fdo-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/fdo-users

_______________________________________________
fdo-users mailing list
fdo-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/fdo-users
_______________________________________________
fdo-users mailing list
fdo-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/fdo-users


More information about the fdo-users mailing list