[Featureserver] curl usage issue

Yves Moisan yves.moisan at boreal-is.com
Thu Dec 4 11:48:37 EST 2008


Hi All,

I'm trying to upload a .json file 

{"features": [{"geometry": {"type": "Point", "coordinates":
[[411869.733939, 8831369.48172]]}, "id": 99999, "properties":
{"comment": "99999", "the_geom":
"0101000080BCD28DEF5A23194199456ACF30D86041A78B461654CB9540"}}]}

C:\temp>curl -d @fs-test.json  http://my.machine:8084/PGTEST/create.json
An error occurred: column "the_geom" specified more than once
LINE 1: ...SERT INTO "geo_survey_gps_pt" (comment, the_geom,
the_geom) ...
                                                             ^

  File "C:\featureserver-1.12\FeatureServer\Server.py", line 242, in
wsgiHandler
    format, content = service.dispatchRequest( params, path_info, host,
post_data, request_method, accepts )
  File "C:\featureserver-1.12\FeatureServer\Server.py", line 145, in
dispatchRequest
    result = method(action)
  File "C:\featureserver-1.12\FeatureServer\DataSource\PostGIS.py", line
142, in create
    cursor.execute(str(sql), self.feature_values(feature))

If I erase the "the_geom" property from my file :

{"features": [{"geometry": {"type": "Point", "coordinates":
[[411869.733939, 8831369.48172]]}, "id": 99999, "properties":
{"comment": "99999"}}]}

I get :

C:\temp>curl -d @fs-test.json  http://my.machine:8084/PGTEST/create.json
An error occurred: new row for relation "geo_survey_gps_pt" violates
check constraint "enforce_srid_the_geom"

  File "C:\featureserver-1.12\FeatureServer\Server.py", line 242, in
wsgiHandler
    format, content = service.dispatchRequest( params, path_info, host,
post_data, request_method, accepts )
  File "C:\featureserver-1.12\FeatureServer\Server.py", line 145, in
dispatchRequest
    result = method(action)
  File "C:\featureserver-1.12\FeatureServer\DataSource\PostGIS.py", line
142, in create
    cursor.execute(str(sql), self.feature_values(feature))

because there is indeed a constraint in the table.

Pointers appreciated.

TIA,

Yves Moisan





More information about the Featureserver mailing list