Hi Yves,<div><br></div><div>Your geojson upload to featureserver does indeed include the geometry twice: Both described as 'Point' and in your the_geom column. So you don't want to include the_geom in your upload - remove it from your geojson and it should work. <div>
<br></div><div>In general, featureserver shouldn't return your the_geom column in the first place, but that's another story (an OT side note: the FS docs should explain, in the postgis section, how to have it return only a subset of columns if you want -- although again, it shouldn't be returning your the_geom column column at all assuming it's the only geometry column on the table )</div>
<div><br></div><div> -Josh<br><br><div class="gmail_quote">On Thu, Dec 4, 2008 at 8:48 AM, Yves Moisan <span dir="ltr"><<a href="mailto:yves.moisan@boreal-is.com">yves.moisan@boreal-is.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi All,<br>
<br>
I'm trying to upload a .json file<br>
<br>
{"features": [{"geometry": {"type": "Point", "coordinates":<br>
[[411869.733939, 8831369.48172]]}, "id": 99999, "properties":<br>
{"comment": "99999", "the_geom":<br>
"0101000080BCD28DEF5A23194199456ACF30D86041A78B461654CB9540"}}]}<br>
<br>
C:\temp>curl -d @fs-test.json <a href="http://my.machine:8084/PGTEST/create.json" target="_blank">http://my.machine:8084/PGTEST/create.json</a><br>
An error occurred: column "the_geom" specified more than once<br>
LINE 1: ...SERT INTO "geo_survey_gps_pt" (comment, the_geom,<br>
the_geom) ...<br>
^<br>
<br>
File "C:\featureserver-1.12\FeatureServer\Server.py", line 242, in<br>
wsgiHandler<br>
format, content = service.dispatchRequest( params, path_info, host,<br>
post_data, request_method, accepts )<br>
File "C:\featureserver-1.12\FeatureServer\Server.py", line 145, in<br>
dispatchRequest<br>
result = method(action)<br>
File "C:\featureserver-1.12\FeatureServer\DataSource\PostGIS.py", line<br>
142, in create<br>
cursor.execute(str(sql), self.feature_values(feature))<br>
<br>
If I erase the "the_geom" property from my file :<br>
<br>
{"features": [{"geometry": {"type": "Point", "coordinates":<br>
[[411869.733939, 8831369.48172]]}, "id": 99999, "properties":<br>
{"comment": "99999"}}]}<br>
<br>
I get :<br>
<br>
C:\temp>curl -d @fs-test.json <a href="http://my.machine:8084/PGTEST/create.json" target="_blank">http://my.machine:8084/PGTEST/create.json</a><br>
An error occurred: new row for relation "geo_survey_gps_pt" violates<br>
check constraint "enforce_srid_the_geom"<br>
<br>
File "C:\featureserver-1.12\FeatureServer\Server.py", line 242, in<br>
wsgiHandler<br>
format, content = service.dispatchRequest( params, path_info, host,<br>
post_data, request_method, accepts )<br>
File "C:\featureserver-1.12\FeatureServer\Server.py", line 145, in<br>
dispatchRequest<br>
result = method(action)<br>
File "C:\featureserver-1.12\FeatureServer\DataSource\PostGIS.py", line<br>
142, in create<br>
cursor.execute(str(sql), self.feature_values(feature))<br>
<br>
because there is indeed a constraint in the table.<br>
<br>
Pointers appreciated.<br>
<br>
TIA,<br>
<br>
Yves Moisan<br>
<br>
<br>
_______________________________________________<br>
Featureserver mailing list<br>
<a href="mailto:Featureserver@openlayers.org">Featureserver@openlayers.org</a><br>
<a href="http://featureserver.org/mailman/listinfo/featureserver" target="_blank">http://featureserver.org/mailman/listinfo/featureserver</a><br>
</blockquote></div><br></div></div>