hello and thanks for the reply;
the openlayer .html file is as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet"
href="/geoserver/data/www/openlayers/theme/default/style.css"
type="text/css" />
<style type="text/css">
body {
margin: 1em;
}
#map {
width: 800px;
height: 475px;
border: 1px solid black;
}
</style>
<script
src='http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.1’></script>
<script
src='http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAOOudwJU6hgsLHp1flVP3aBQ0op6ZnFELFY03haNRq3ihXdBYWxRjKqru3v4uWPcmE8w9fQA_q0yevQ’></script>
<script
src="http://api.maps.yahoo.com/ajaxymap?v=3.0&appid=euzuro-openlayers"></script>
<script src="http://openlayers.org/api/OpenLayers.js"></script>
<script type="text/javascript">
OpenLayers.IMAGE_RELOAD_ATTEMPTS = 3;
//
// Common code to create a map object and add the Google base layers
//
var lon = 16;
var lat = 45;
var zoom = 4;
var map;
// Common code to create a map object and add the Google base layers
function initMap() {
var options = {
projection: new OpenLayers.Projection("EPSG:900913"),
displayProjection: new OpenLayers.Projection("EPSG:4326"),
units: "m",
maxResolution: 156543.0339,
maxExtent: new OpenLayers.Bounds(-20037508, -20037508,
20037508, 20037508.34)
};
map = new OpenLayers.Map( 'map', options ,
{controls:[new OpenLayers.Control.MouseDefaults(),
new OpenLayers.Control.LayerSwitcher(),
new OpenLayers.Control.PanZoomBar()],
numZoomLevels:20});
var gmap = new OpenLayers.Layer.Google(
"Google Streets",
{'sphericalMercator': true}
);
map.addLayers([gmap]);
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
}
function init(){
initMap(); // Set up base map
// Initialize WMS layer from our local GeoServer
var montagne = new OpenLayers.Layer.WFS(
"montagne",
"/geoserver/wfs",
{typename: 'topp:t_coordinate_ritrovamento1'},
{
typename: 't_coordinate_ritrovamento1',
featureNS: 'http://www.openplans.org/topp’,
extractAttributes: false
}
);
montagne.style = OpenLayers.Util.applyDefaults({strokeColor:
"#ff0000"},
OpenLayers.Feature.Vector.style["default"]);
// Add WMS layer to our map
map.addLayer(montagne);
var panel = new OpenLayers.Control.Panel(
{displayClass: 'olControlEditingToolbar'}
);
function deleteFeature(geometry)
{
this.state = OpenLayers.State.DELETE;
this.layer.removeFeatures(geometry);
this.renderIntent = "select";
}
var deleteControl = new OpenLayers.Control.SelectFeature(montagne,{title:
"Delete Feature",
onSelect: deleteFeature,
displayClass: "olControlDeleteFeature"});
var drawPoint = new OpenLayers.Control.DrawFeature(
montagne, OpenLayers.Handler.Point,
{displayClass: 'olControlDrawFeaturePoint'}
);
drawPoint.featureAdded = function(feature) {
feature.layer.eraseFeatures([feature]);
// cast to multipoint
feature.geometry = new OpenLayers.Geometry.MultiPoint(
feature.geometry
);
feature.style.strokeColor = "#0000ff";
feature.state = OpenLayers.State.INSERT;
feature.layer.drawFeature(feature);
}
var drawPolygon = new OpenLayers.Control.DrawFeature(
montagne, OpenLayers.Handler.Polygon,
{displayClass: 'olControlDrawFeaturePolygon'}
);
drawPolygon.featureAdded = function(feature) {
feature.layer.eraseFeatures([feature]);
// cast to multipoint
feature.geometry = new OpenLayers.Geometry.MultiPolygon(
feature.geometry
);
feature.style.strokeColor = "#0000ff";
feature.state = OpenLayers.State.INSERT;
feature.layer.drawFeature(feature);
}
var drawLine = new OpenLayers.Control.DrawFeature(
montagne, OpenLayers.Handler.Path,
{displayClass: 'olControlDrawFeaturePath'}
);
drawLine.featureAdded = function(feature) {
feature.layer.eraseFeatures([feature]);
// cast to multilinestring
feature.geometry = new OpenLayers.Geometry.MultiLineString(
feature.geometry
);
feature.style.strokeColor = "#ff0000";
feature.state = OpenLayers.State.INSERT;
feature.layer.drawFeature(feature);
}
var modify = new OpenLayers.Control.ModifyFeature(montagne, {
title: "Modify Feature",
displayClass: "olControlModifyFeature"
});
var save = new OpenLayers.Control.Button({
trigger: OpenLayers.Function.bind(montagne.commit,
montagne),
displayClass: "olControlSaveFeatures"
});
panel.addControls(
[new OpenLayers.Control.Navigation(), drawPoint,
drawPolygon, drawLine, modify, save, deleteControl]
);
map.addControl(panel);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.addControl(new OpenLayers.Control.Permalink());
map.addControl(new OpenLayers.Control.MousePosition());
map.setCenter(new OpenLayers.LonLat(17.99,59.3),2);
}
</script>
</head>
<body onload="init()">
<div id="map"></div>
</body>
</html>
-- in GeoServer, the layer has the coordinate system EPSG: 900913;
-- in mysql table, the geometric field is formatted as a POINT
thank you again
Paolo
Rahkonen Jukka wrote:
Hi,
It looks like your application is sending those coordinates for Geoserver.
Can you control it and capture the wfs insert message?
-Jukka Rahkonen-
paolotome wrote:
Hello everyone,
I have a problem saving data from a WFS-T: when I save (in a mysql
database)
the point drawn on the map, a new record is created in the database, but
in
the field point coordinates are always: POINT (0 0).
Anyone has any idea about the source of the problem?
geoserver.log
2010-11-11 10:42:01,265 INFO [geoserver.wfs] -
Request: getServiceInfo
2010-11-11 10:42:01,330 INFO [gwc.GWCCleanser] - Deleting GWC cache for
topp:t_coordinate_ritrovamento1
2010-11-11 10:42:01,336 INFO [file.FileBlobStore] -
/var/lib/tomcat5.5/temp/geowebcache/topp_t_coordinate_ritrovamento1 does
not
exist or is not writable
2010-11-11 10:42:01,336 INFO [gwc.GWCCleanser] - GWC cache for
topp:t_coordinate_ritrovamento1 deleted successfully
2010-11-11 10:42:01,399 INFO [geoserver.wfs] -
Request: transaction
handle = null
service = WFS
version = 1.0.0
baseUrl = http://localhost:8180/geoserver/
providedVersion = null
lockId = null
group = [wfs:insert=net.opengis.wfs.impl.InsertElementTypeImpl@anonymised.com
(feature:
[SimpleFeatureImpl:t_coordinate_ritrovamento1=[SimpleFeatureImpl.Attribute:
id_coordinate_ritrovamento<id_coordinate_ritrovamento
id=fid--708a6e26_12c3a274ecf_-7fdd>=null, SimpleFeatureImpl.Attribute:
geom<geom id=fid--708a6e26_12c3a274ecf_-7fdd>=POINT (0 0),
SimpleFeatureImpl.Attribute: id_scheda_generale<id_scheda_generale
id=fid--708a6e26_12c3a274ecf_-7fdd>=0, SimpleFeatureImpl.Attribute:
autore<autore id=fid--708a6e26_12c3a274ecf_-7fdd>=null]], handle: null,
idgen: <unset>, inputFormat: <unset>, srsName: null)]
insert = [net.opengis.wfs.impl.InsertElementTypeImpl@anonymised.com (feature:
[SimpleFeatureImpl:t_coordinate_ritrovamento1=[SimpleFeatureImpl.Attribute:
id_coordinate_ritrovamento<id_coordinate_ritrovamento
id=fid--708a6e26_12c3a274ecf_-7fdd>=null, SimpleFeatureImpl.Attribute:
geom<geom id=fid--708a6e26_12c3a274ecf_-7fdd>=POINT (0 0),
SimpleFeatureImpl.Attribute: id_scheda_generale<id_scheda_generale
id=fid--708a6e26_12c3a274ecf_-7fdd>=0, SimpleFeatureImpl.Attribute:
autore<autore id=fid--708a6e26_12c3a274ecf_-7fdd>=null]], handle: null,
idgen: <unset>, inputFormat: <unset>, srsName: null)]
update =
delete =
native =
releaseAction = ALL
--
View this message in context:
http://old.nabble.com/WFS-T-insert-point%3A-problem--->-POINT-(0-0)-tp30189207p30189207.html
Sent from the GeoServer - User mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
--
View this message in context: http://old.nabble.com/WFS-T-insert-point%3A-problem--->-POINT-(0-0)-tp30189207p30197520.html
Sent from the GeoServer - User mailing list archive at Nabble.com.