Ciao Salvatore,
credo di si...
Se vuoi puoi vedere un'esempio nel codice di cartoweb3, precisamente nel plugin Edition che fa più o meno la stessa cosa...

Facci sapere.

--
Ing. Fabio D'Ovidio

INOVA Open Solutions s.r.l.
Web : http://www.inovaos.it
Tel.: 081 197 57 600
mail: [EMAIL PROTECTED]




Salvator*eL*arosa ha scritto:
Salve a tutti,

Secondo voi è possibile modificare questa funzione
per far inserire un poligono all'interno del DB da p.mapper:

function DB_addPoint($imgxy, $stato, $uso)
{ $db_host = "localhost"; $db_type = "pgsql";
    $db_name = "cms";
    $db_user = "postgres";
    $db_pwd  = "";
$dsn = "$db_type://$db_user:[EMAIL PROTECTED]/$db_name"; // CONVERT PIXEL X/Y TO MAP UNITS
    $imgxy_arr = explode(" ", $imgxy);
    $x_pix = $imgxy_arr[0];
$y_pix = $imgxy_arr[1]; //"per esempio: se aumento l'array //come posso modificare l'SQL per
l'inserimento"
$GEOEXT = $_SESSION["GEOEXT"];
    $geoDeltaX = $GEOEXT["maxx"] - $GEOEXT["minx"];
    $geoDeltaY = $GEOEXT["maxy"] - $GEOEXT["miny"];
$mapW = $_SESSION["mapwidth"];
    $mapH = $_SESSION["mapheight"];
$x_geo = round($GEOEXT["minx"] + (($x_pix/$mapW)*$geoDeltaX)); $y_geo = round($GEOEXT["maxy"] - (($y_pix/$mapH)*$geoDeltaY)); // CONNECT TO DB AND RUN QUERY $geometry = "GeomFromText('POINT($x_geo $y_geo)',3004)"; $sql = "INSERT INTO domande(stato,uso,geom)
VALUES('$stato','$uso',$geometry)";
    //error_log ($sql);
$dbh = dbConnect($dsn);
    $result = $dbh->query($sql);

    // Check that $result is not an error
    if (DB::isError($result)) {
        $dbh->disconnect();
        return ($result->getMessage());
    } else {
        $dbh->disconnect();
        return 1;
    }
}

Questa è relativa all'inserimento di un punto!

Grazie

-----
Salvatore Larosa
GPG: 0xE504BBE2 (FP: D9B2 CA87 81CD 1B91 E24D 3B42 D0F7 FA01 E504 BBE2)


_______________________________________________
Iscriviti all'associazione GFOSS.it: http://www.gfoss.it/drupal/iscrizione
[email protected]
http://www.faunalia.com/cgi-bin/mailman/listinfo/gfoss
Questa e' una lista di discussione pubblica aperta a tutti.
I messaggi di questa lista non rispecchiano necessariamente
le posizioni dell'Associazione GFOSS.it.

Rispondere a