I have created a schema in PostGIS as follows:

CREATE TABLE points
(
  uid character varying NOT NULL,
  "lastEditDTG" integer,
  "name" character varying,
  originator character varying,
  "recordSite" character varying,
  remarks character varying,
  caveat character varying,
  "portCoordinates" geometry,
  CONSTRAINT puid PRIMARY KEY (uid),
  CONSTRAINT "enforce_dims_portCoordinates" CHECK
(st_ndims("portCoordinates") = 2),
  CONSTRAINT "enforce_geotype_portCoordinates" CHECK
(geometrytype("portCoordinates") = 'POINT'::text OR "portCoordinates" IS
NULL),
  CONSTRAINT "enforce_srid_portCoordinates" CHECK
(st_srid("portCoordinates") = 4326)
)
WITH (
  OIDS=FALSE
);
ALTER TABLE points OWNER TO postgres;


When I try to insert a new feature into this store, the UID field is being
saved as a hex value (which I am assuming is the location in memory based on
the incrementing nature of it). This is my sample WFS-T insert GML:


<wfs:Transaction service="WFS" version="1.0.0"
  xmlns:wfs="http://www.opengis.net/wfs";
  xmlns:WSM="WSM"
  xmlns:gml="http://www.opengis.net/gml";
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xsi:schemaLocation="http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd
http://localhost:8080/geoserver/wfs/DescribeFeatureType?typename=WSM:points";>
    <wfs:Insert>
      <WSM:points>
        <WSM:uid>test.David.123456</WSM:uid>
        <WSM:lastEditDTG>123456789</WSM:lastEditDTG>
        <WSM:name>DAVID 1</WSM:name>
        <WSM:originator/>
        <WSM:recordSite>WSMSite</WSM:recordSite>
        <WSM:remarks/>
        <WSM:caveat/>
        <WSM:portCoordinates>
          <gml:Point srsName="http://www.opengis.net/gml/srs/epsg.xml#4326";>
            <gml:coordinates xmlns:gml="http://www.opengis.net/gml";
decimal="." cs="," ts=" ">13,37</gml:coordinates>
          </gml:Point>
        </WSM:portCoordinates>
      </WSM:points>
    </wfs:Insert>
</wfs:Transaction>


When I look at the data in the table after I have just inserted the new
feature, it inserts just fine, but the UID field turns into
"fid--3b44cfe4_133eb233923_-7f86". I have my primary keys exposed for my
PostGIS connection, and my describe feature xsd is (using
http://localhost:8080/geoserver/wfs/DescribeFeatureType?typename=WSM:points):

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:AWSM="AWSM"
xmlns:WSM="WSM" xmlns:cite="http://www.opengeospatial.net/cite";
xmlns:drizzle="drizzle" xmlns:gml="http://www.opengis.net/gml";
xmlns:it.geosolutions="http://www.geo-solutions.it";
xmlns:nurc="http://www.nurc.nato.int";
xmlns:nyc_roads="http://opengeo.org/nyc_roads";
xmlns:sde="http://geoserver.sf.net";
xmlns:sf="http://www.openplans.org/spearfish";
xmlns:tiger="http://www.census.gov";
xmlns:topp="http://www.openplans.org/topp"; elementFormDefault="qualified"
targetNamespace="WSM">
<xsd:import namespace="http://www.opengis.net/gml";
schemaLocation="http://localhost:8080/geoserver/schemas/gml/3.1.1/base/gml.xsd"/>
<xsd:complexType name="pointsType">
<xsd:complexContent>
<xsd:extension base="gml:AbstractFeatureType">
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="uid" nillable="false"
type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="0" name="lastEditDTG" nillable="true"
type="xsd:int"/>
<xsd:element maxOccurs="1" minOccurs="0" name="originator" nillable="true"
type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="0" name="recordSite" nillable="true"
type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="0" name="remarks" nillable="true"
type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="0" name="caveat" nillable="true"
type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="0" name="portCoordinates"
nillable="true" type="gml:PointPropertyType"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="points" substitutionGroup="gml:_Feature"
type="WSM:pointsType"/>
</xsd:schema>


I'm unsure what I'm doing wrong. If I try to insert something else, the new
uid is "fid--3b44cfe4_133eb233923_-7f83", which is the same as the previous
feature insert with the last two digits being different. Is GeoServer
treating my primary key as the featureID (fid) and storing it as "fid--..."
where the hex values is the actual space in memory it is being stored
locally?

Is my GML correct for my WFS-T Insert? I have also tried the value inside my
<WSM:uid> tags as an element of <WSM:points> called fid="..." and it still
gives me the hex values.

I'm stumped, anyone have any insight? Thanks

--
View this message in context: 
http://osgeo-org.1803224.n2.nabble.com/PostGIS-WFS-T-Insert-Primary-Key-is-being-stored-as-hex-value-tp7040973p7040973.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to