#include "lwgeom_geos.h"
#include <stdio.h>
+#include <inttypes.h> /* for PRId64 */
#include <errno.h>
/*********************************************************************
minaz = maxaz = -1;
}
- LWDEBUGF(1, "Looking for edges incident to node %lld "
- "and adjacent to azimuth %g", node, data->myaz);
+ LWDEBUGF(1, "Looking for edges incident to node %" PRId64
+ " and adjacent to azimuth %g", node, data->myaz);
/* Get incident edges */
edges = lwt_be_getEdgeByNode( topo, &node, &numedges, LWT_COL_EDGE_ALL );
if ( pa->npoints < 2 ) {
lwgeom_free(cleangeom);
- lwerror("corrupted topology: edge %lld does not have two distinct points", edge->edge_id);
+ lwerror("corrupted topology: edge %" PRId64
+ " does not have two distinct points", edge->edge_id);
return -1;
}
if ( edge->start_node == node ) {
getPoint2d_p(pa, 0, &p1);
getPoint2d_p(pa, 1, &p2);
- LWDEBUGF(1, "edge %lld starts on node %lld, edgeend is %g,%g-%g,%g",
+ LWDEBUGF(1, "edge %" PRId64
+ "starts on node %" PRId64
+ ", edgeend is %g,%g-%g,%g",
edge->edge_id, node, p1.x, p1.y, p2.x, p2.y);
if ( ! azimuth_pt_pt(&p1, &p2, &az) ) {
lwgeom_free(cleangeom);
return -1;
}
azdif = az - data->myaz;
- LWDEBUGF(1, "azimuth of edge %lld: %g (diff: %g)", edge->edge_id, az, azdif);
+ LWDEBUGF(1, "azimuth of edge %" PRId64
+ ": %g (diff: %g)", edge->edge_id, az, azdif);
if ( azdif < 0 ) azdif += 2 * M_PI;
if ( minaz == -1 ) {
data->nextCW = data->nextCCW = edge->edge_id; /* outgoing */
data->cwFace = edge->face_left;
data->ccwFace = edge->face_right;
- LWDEBUGF(1, "new nextCW and nextCCW edge is %lld, "
- "outgoing, "
- "with face_left %lld and face_right %lld "
- "(face_right is new ccwFace, face_left is new cwFace)",
+ LWDEBUGF(1, "new nextCW and nextCCW edge is %" PRId64
+ ", outgoing, "
+ "with face_left %" PRId64 " and face_right %" PRId64
+ " (face_right is new ccwFace, face_left is new cwFace)",
edge->edge_id, edge->face_left,
edge->face_right);
} else {
if ( azdif < minaz ) {
data->nextCW = edge->edge_id; /* outgoing */
data->cwFace = edge->face_left;
- LWDEBUGF(1, "new nextCW edge is %lld, "
+ LWDEBUGF(1, "new nextCW edge is %" PRId64 ", "
"outgoing, "
- "with face_left %lld and face_right %lld "
+ "with face_left %" PRId64 " and face_right %" PRId64 " "
"(previous had minaz=%g, face_left is new cwFace)",
edge->edge_id, edge->face_left,
edge->face_right, minaz);
else if ( azdif > maxaz ) {
data->nextCCW = edge->edge_id; /* outgoing */
data->ccwFace = edge->face_right;
- LWDEBUGF(1, "new nextCCW edge is %lld, "
+ LWDEBUGF(1, "new nextCCW edge is %" PRId64 ", "
"outgoing, "
- "with face_left %lld and face_right %lld "
+ "with face_left %" PRId64 " and face_right %" PRId64 " "
"(previous had maxaz=%g, face_right is new ccwFace)",
edge->edge_id, edge->face_left,
edge->face_right, maxaz);
if ( edge->end_node == node ) {
getPoint2d_p(pa, pa->npoints-1, &p1);
getPoint2d_p(pa, pa->npoints-2, &p2);
- LWDEBUGF(1, "edge %lld ends on node %lld, edgeend is %g,%g-%g,%g",
+ LWDEBUGF(1, "edge %" PRId64 " ends on node %" PRId64
+ ", edgeend is %g,%g-%g,%g",
edge->edge_id, node, p1.x, p1.y, p2.x, p2.y);
if ( ! azimuth_pt_pt(&p1, &p2, &az) ) {
lwgeom_free(cleangeom);
return -1;
}
azdif = az - data->myaz;
- LWDEBUGF(1, "azimuth of edge %lld: %g (diff: %g)", edge->edge_id, az, azdif);
+ LWDEBUGF(1, "azimuth of edge %" PRId64
+ ": %g (diff: %g)", edge->edge_id, az, azdif);
if ( azdif < 0 ) azdif += 2 * M_PI;
if ( minaz == -1 ) {
minaz = maxaz = azdif;
data->nextCW = data->nextCCW = -edge->edge_id; /* incoming */
data->cwFace = edge->face_right;
data->ccwFace = edge->face_left;
- LWDEBUGF(1, "new nextCW and nextCCW edge is %lld, "
+ LWDEBUGF(1, "new nextCW and nextCCW edge is %" PRId64 ", "
"incoming, "
- "with face_left %lld and face_right %lld "
+ "with face_left %" PRId64 " and face_right %" PRId64 " "
"(face_right is new cwFace, face_left is new ccwFace)",
edge->edge_id, edge->face_left,
edge->face_right);
if ( azdif < minaz ) {
data->nextCW = -edge->edge_id; /* incoming */
data->cwFace = edge->face_right;
- LWDEBUGF(1, "new nextCW edge is %lld, "
+ LWDEBUGF(1, "new nextCW edge is %" PRId64 ", "
"incoming, "
- "with face_left %lld and face_right %lld "
- "(previous had minaz=%g, face_right is new cwFace)",
+ "with face_left %" PRId64 " and face_right %" PRId64
+ " (previous had minaz=%g, face_right is new cwFace)",
edge->edge_id, edge->face_left,
edge->face_right, minaz);
minaz = azdif;
else if ( azdif > maxaz ) {
data->nextCCW = -edge->edge_id; /* incoming */
data->ccwFace = edge->face_left;
- LWDEBUGF(1, "new nextCCW edge is %lld, "
+ LWDEBUGF(1, "new nextCCW edge is %" PRId64 ", "
"outgoing from start point, "
- "with face_left %lld and face_right %lld "
- "(previous had maxaz=%g, face_left is new ccwFace)",
+ "with face_left %" PRId64 " and face_right %" PRId64
+ " (previous had maxaz=%g, face_left is new ccwFace)",
edge->edge_id, edge->face_left,
edge->face_right, maxaz);
maxaz = azdif;
}
if ( edges ) lwfree(edges); /* there might be none */
- LWDEBUGF(1, "edges adjacent to azimuth %g (incident to node %lld): "
- "CW:%lld(%g) CCW:%lld(%g)",
- data->myaz, node, data->nextCW, minaz,
- data->nextCCW, maxaz);
+ LWDEBUGF(1, "edges adjacent to azimuth %g"
+ " (incident to node %" PRId64 ")"
+ ": CW:%" PRId64 "(%g) CCW:%" PRId64 "(%g)",
+ data->myaz, node, data->nextCW, minaz,
+ data->nextCCW, maxaz);
if ( numedges && data->cwFace != data->ccwFace )
{
if ( data->cwFace != -1 && data->ccwFace != -1 ) {
- lwerror("Corrupted topology: adjacent edges %lld and %lld "
- "bind different face (%lld and %lld)",
+ lwerror("Corrupted topology: adjacent edges %" PRId64 " and %" PRId64
+ " bind different face (%" PRId64 " and %" PRId64 ")",
numedges, data->nextCW, data->nextCCW,
data->cwFace, data->ccwFace);
return -1;
signed_edge_ids = lwt_be_getRingEdges(topo, sedge,
&num_signed_edge_ids, 0);
if ( ! signed_edge_ids ) {
- lwerror("Backend error (no ring edges for edge %lld): %s",
+ lwerror("Backend error (no ring edges for edge %" PRId64 "): %s",
sedge, lwt_be_lastErrorMessage(topo->be_iface));
return -2;
}
}
}
- LWDEBUGF(1, "Edge %lld splitted face %lld (mbr_only:%d)",
+ LWDEBUGF(1, "Edge %" PRId64 " splitted face %" PRId64 " (mbr_only:%d)",
sedge, face, mbr_only);
/* Construct a polygon using edges of the ring */
for ( i=0; i<num_signed_edge_ids; ++i )
{
LWT_ELEMID eid = signed_edge_ids[i];
- LWDEBUGF(1, "Edge %d in ring of edge %lld is edge %lld", i, sedge, eid);
+ LWDEBUGF(1, "Edge %d in ring of edge %" PRId64 " is edge %" PRId64,
+ i, sedge, eid);
LWT_ISO_EDGE *edge = NULL;
POINTARRAY *epa;
for ( j=0; j<numedges; ++j )
LWPOLY* shell = lwpoly_construct(0, 0, 1, points);
int isccw = ptarray_isccw(pa);
- LWDEBUGF(1, "Ring of edge %lld is %sclockwise", sedge, isccw ? "counter" : "");
+ LWDEBUGF(1, "Ring of edge %" PRId64 " is %sclockwise",
+ sedge, isccw ? "counter" : "");
const GBOX* shellbox = lwgeom_get_bbox(lwpoly_as_lwgeom(shell));
if ( face == 0 )
else if ( newedge.face_left != node->containing_face )
{
lwerror("SQL/MM Spatial exception - geometry crosses an edge"
- " (endnodes in faces %lld and %lld)",
+ " (endnodes in faces %" PRId64 " and %" PRId64 ")",
newedge.face_left, node->containing_face);
}
}
- lwnotice("Node %d, with geom %p (looking for %d and %d)", node->node_id, node->geom, start_node, end_node);
+ lwnotice("Node %d, with geom %p (looking for %d and %d)",
+ node->node_id, node->geom, start_node, end_node);
if ( node->node_id == start_node ) {
start_node_geom = node->geom;
}
if ( match == 2 ) {
lwerror("GEOSRelatePatternMatch error: %s", lwgeom_geos_errmsg);
} else {
- lwerror("SQL/MM Spatial exception - coincident edge %lld",
+ lwerror("SQL/MM Spatial exception - coincident edge %" PRId64,
edge->edge_id);
}
return -1;
if ( match == 2 ) {
lwerror("GEOSRelatePatternMatch error: %s", lwgeom_geos_errmsg);
} else {
- lwerror("Spatial exception - geometry intersects edge %lld",
+ lwerror("Spatial exception - geometry intersects edge %" PRId64,
edge->edge_id);
}
return -1;
if ( match == 2 ) {
lwerror("GEOSRelatePatternMatch error: %s", lwgeom_geos_errmsg);
} else {
- lwerror("SQL/MM Spatial exception - geometry crosses edge %lld",
- edge->edge_id);
+ lwerror("SQL/MM Spatial exception - geometry crosses edge %"
+ PRId64, edge->edge_id);
}
return -1;
}
*/
if ( newedge.face_left != newedge.face_right )
{
- lwerror("Left(%lld)/right(%lld) faces mismatch: invalid topology ?",
- newedge.face_left, newedge.face_right);
+ lwerror("Left(%" PRId64 ")/right(%" PRId64 ")"
+ "faces mismatch: invalid topology ?",
+ newedge.face_left, newedge.face_right);
return -1;
}
else if ( newedge.face_left == -1 )
{
- lwerror("Could not derive edge face from linked primitives: invalid topology ?");
+ lwerror("Could not derive edge face from linked primitives:"
+ " invalid topology ?");
return -1;
}
#include "lib/stringinfo.h"
//#include "funcapi.h"
#include "executor/spi.h" /* this is what you need to work with SPI */
+#include "inttypes.h" /* for PRId64 */
#include "../postgis_config.h"
# define GNU_PRINTF23
#endif
+#define ABS(x) (x<0?-x:x)
+
/*
* This is required for builds against pgsql
*/
appendStringInfoChar(str, '(');
if ( fields & LWT_COL_EDGE_EDGE_ID ) {
- if ( edge->edge_id != -1 ) appendStringInfo(str, "%lld", edge->edge_id);
+ if ( edge->edge_id != -1 ) appendStringInfo(str, "%" PRId64, edge->edge_id);
else appendStringInfoString(str, "DEFAULT");
sep = ",";
}
if ( fields & LWT_COL_EDGE_START_NODE ) {
- appendStringInfo(str, "%s%lld", sep, edge->start_node);
+ appendStringInfo(str, "%s%" PRId64, sep, edge->start_node);
sep = ",";
}
if ( fields & LWT_COL_EDGE_END_NODE ) {
- appendStringInfo(str, "%s%lld", sep, edge->end_node);
+ appendStringInfo(str, "%s%" PRId64, sep, edge->end_node);
sep = ",";
}
if ( fields & LWT_COL_EDGE_FACE_LEFT ) {
- appendStringInfo(str, "%s%lld", sep, edge->face_left);
+ appendStringInfo(str, "%s%" PRId64, sep, edge->face_left);
sep = ",";
}
if ( fields & LWT_COL_EDGE_FACE_RIGHT ) {
- appendStringInfo(str, "%s%lld", sep, edge->face_right);
+ appendStringInfo(str, "%s%" PRId64, sep, edge->face_right);
sep = ",";
}
if ( fields & LWT_COL_EDGE_NEXT_LEFT ) {
- appendStringInfo(str, "%s%lld", sep, edge->next_left);
- if ( fullEdgeData ) appendStringInfo(str, ",%lld", llabs(edge->next_left));
+ appendStringInfo(str, "%s%" PRId64, sep, edge->next_left);
+ if ( fullEdgeData ) appendStringInfo(str, ",%" PRId64, ABS(edge->next_left));
sep = ",";
}
if ( fields & LWT_COL_EDGE_NEXT_RIGHT ) {
- appendStringInfo(str, "%s%lld", sep, edge->next_right);
- if ( fullEdgeData ) appendStringInfo(str, ",%lld", llabs(edge->next_right));
+ appendStringInfo(str, "%s%" PRId64, sep, edge->next_right);
+ if ( fullEdgeData ) appendStringInfo(str, ",%" PRId64, ABS(edge->next_right));
sep = ",";
}
if ( fields & LWT_COL_EDGE_GEOM )
if ( fields & LWT_COL_EDGE_EDGE_ID ) {
appendStringInfoString(str, "edge_id ");
- appendStringInfo(str, "%s %lld", op, edge->edge_id);
+ appendStringInfo(str, "%s %" PRId64, op, edge->edge_id);
sep = sep1;
}
if ( fields & LWT_COL_EDGE_START_NODE ) {
appendStringInfo(str, "%sstart_node ", sep);
- appendStringInfo(str, "%s %lld", op, edge->start_node);
+ appendStringInfo(str, "%s %" PRId64, op, edge->start_node);
sep = sep1;
}
if ( fields & LWT_COL_EDGE_END_NODE ) {
appendStringInfo(str, "%send_node", sep);
- appendStringInfo(str, "%s %lld", op, edge->end_node);
+ appendStringInfo(str, "%s %" PRId64, op, edge->end_node);
sep = sep1;
}
if ( fields & LWT_COL_EDGE_FACE_LEFT ) {
appendStringInfo(str, "%sleft_face", sep);
- appendStringInfo(str, "%s %lld", op, edge->face_left);
+ appendStringInfo(str, "%s %" PRId64, op, edge->face_left);
sep = sep1;
}
if ( fields & LWT_COL_EDGE_FACE_RIGHT ) {
appendStringInfo(str, "%sright_face", sep);
- appendStringInfo(str, "%s %lld", op, edge->face_right);
+ appendStringInfo(str, "%s %" PRId64, op, edge->face_right);
sep = sep1;
}
if ( fields & LWT_COL_EDGE_NEXT_LEFT ) {
appendStringInfo(str, "%snext_left_edge", sep);
- appendStringInfo(str, "%s %lld", op, edge->next_left);
+ appendStringInfo(str, "%s %" PRId64, op, edge->next_left);
sep = sep1;
if ( fullEdgeData ) {
appendStringInfo(str, "%s abs_next_left_edge", sep);
- appendStringInfo(str, "%s %lld", op, llabs(edge->next_left));
+ appendStringInfo(str, "%s %" PRId64, op, ABS(edge->next_left));
}
}
if ( fields & LWT_COL_EDGE_NEXT_RIGHT ) {
appendStringInfo(str, "%snext_right_edge", sep);
- appendStringInfo(str, "%s %lld", op, edge->next_right);
+ appendStringInfo(str, "%s %" PRId64, op, edge->next_right);
sep = sep1;
if ( fullEdgeData ) {
appendStringInfo(str, "%s abs_next_right_edge", sep);
- appendStringInfo(str, "%s %lld", op, llabs(edge->next_right));
+ appendStringInfo(str, "%s %" PRId64, op, ABS(edge->next_right));
}
}
if ( fields & LWT_COL_EDGE_GEOM ) {
if ( fields & LWT_COL_NODE_NODE_ID ) {
appendStringInfoString(str, "node_id ");
- appendStringInfo(str, "%s %lld", op, node->node_id);
+ appendStringInfo(str, "%s %" PRId64, op, node->node_id);
sep = sep1;
}
if ( fields & LWT_COL_NODE_CONTAINING_FACE ) {
appendStringInfo(str, "%scontaining_face %s", sep, op);
if ( node->containing_face != -1 ) {
- appendStringInfo(str, "%lld", node->containing_face);
+ appendStringInfo(str, "%" PRId64, node->containing_face);
} else {
appendStringInfoString(str, "NULL");
}
appendStringInfoChar(str, '(');
if ( fields & LWT_COL_NODE_NODE_ID ) {
- if ( node->node_id != -1 ) appendStringInfo(str, "%lld", node->node_id);
+ if ( node->node_id != -1 ) appendStringInfo(str, "%" PRId64, node->node_id);
else appendStringInfoString(str, "DEFAULT");
sep = ",";
}
if ( fields & LWT_COL_NODE_CONTAINING_FACE ) {
if ( node->containing_face != -1 )
- appendStringInfo(str, "%s%lld", sep, node->containing_face);
+ appendStringInfo(str, "%s%" PRId64, sep, node->containing_face);
else appendStringInfo(str, "%snull", sep);
}
static void
addFaceValues(StringInfo str, LWT_ISO_FACE *face, int srid)
{
- if ( face->face_id != -1 ) appendStringInfo(str, "(%lld", face->face_id);
+ if ( face->face_id != -1 ) appendStringInfo(str, "(%" PRId64, face->face_id);
else appendStringInfoString(str, "(DEFAULT");
if ( face->mbr ) {
appendStringInfoString(sql, " WHERE edge_id IN (");
// add all identifiers here
for (i=0; i<*numelems; ++i) {
- appendStringInfo(sql, "%s%lld", (i?",":""), ids[i]);
+ appendStringInfo(sql, "%s%" PRId64, (i?",":""), ids[i]);
}
appendStringInfoString(sql, ")");
POSTGIS_DEBUGF(1, "cb_getEdgeById query: %s", sql->data);
appendStringInfoString(sql, " WHERE start_node IN (");
// add all identifiers here
for (i=0; i<*numelems; ++i) {
- appendStringInfo(sql, "%s%lld", (i?",":""), ids[i]);
+ appendStringInfo(sql, "%s%" PRId64, (i?",":""), ids[i]);
}
appendStringInfoString(sql, ") OR end_node IN (");
// add all identifiers here
for (i=0; i<*numelems; ++i) {
- appendStringInfo(sql, "%s%lld", (i?",":""), ids[i]);
+ appendStringInfo(sql, "%s%" PRId64, (i?",":""), ids[i]);
}
appendStringInfoString(sql, ")");
appendStringInfoString(sql, " WHERE left_face IN (");
// add all identifiers here
for (i=0; i<*numelems; ++i) {
- appendStringInfo(sql, "%s%lld", (i?",":""), ids[i]);
+ appendStringInfo(sql, "%s%" PRId64, (i?",":""), ids[i]);
}
appendStringInfoString(sql, ") OR right_face IN (");
// add all identifiers here
for (i=0; i<*numelems; ++i) {
- appendStringInfo(sql, "%s%lld", (i?",":""), ids[i]);
+ appendStringInfo(sql, "%s%" PRId64, (i?",":""), ids[i]);
}
appendStringInfoString(sql, ")");
appendStringInfoString(sql, " WHERE face_id IN (");
// add all identifiers here
for (i=0; i<*numelems; ++i) {
- appendStringInfo(sql, "%s%lld", (i?",":""), ids[i]);
+ appendStringInfo(sql, "%s%" PRId64, (i?",":""), ids[i]);
}
appendStringInfoString(sql, ")");
initStringInfo(sql);
appendStringInfo(sql, "WITH RECURSIVE edgering AS ( "
- "SELECT %lld as signed_edge_id, edge_id, next_left_edge, next_right_edge "
- "FROM \"%s\".edge_data WHERE edge_id = %lld UNION "
+ "SELECT %" PRId64
+ " as signed_edge_id, edge_id, next_left_edge, next_right_edge "
+ "FROM \"%s\".edge_data WHERE edge_id = %" PRId64 " UNION "
"SELECT CASE WHEN "
"p.signed_edge_id < 0 THEN p.next_right_edge ELSE p.next_left_edge END, "
"e.edge_id, e.next_left_edge, e.next_right_edge "
"e.edge_id = CASE WHEN p.signed_edge_id < 0 THEN "
"abs(p.next_right_edge) ELSE abs(p.next_left_edge) END ) "
"SELECT * FROM edgering",
- edge, topo->name, llabs(edge), topo->name);
+ edge, topo->name, ABS(edge), topo->name);
if ( limit ) {
++limit; /* so we know if we hit it */
appendStringInfo(sql, " LIMIT %d", limit);
}
val = DatumGetInt32(dat);
edges[i] = val;
- POSTGIS_DEBUGF(1, "Component %d in ring of edge %lld is edge %d",
+ POSTGIS_DEBUGF(1, "Component %d in ring of edge %" PRId64 " is edge %d",
i, edge, val);
}
appendStringInfoString(sql, " WHERE node_id IN (");
// add all identifiers here
for (i=0; i<*numelems; ++i) {
- appendStringInfo(sql, "%s%lld", (i?",":""), ids[i]);
+ appendStringInfo(sql, "%s%" PRId64, (i?",":""), ids[i]);
}
appendStringInfoString(sql, ")");
POSTGIS_DEBUGF(1, "cb_getNodeById query: %s", sql->data);
appendStringInfoString(sql, " WHERE containing_face IN (");
// add all identifiers here
for (i=0; i<*numelems; ++i) {
- appendStringInfo(sql, "%s%lld", (i?",":""), ids[i]);
+ appendStringInfo(sql, "%s%" PRId64, (i?",":""), ids[i]);
}
appendStringInfoString(sql, ")");
POSTGIS_DEBUGF(1, "cb_getNodeByFace query: %s", sql->data);
for (i=0; i<numfaces; ++i) {
const LWT_ISO_FACE* face = &(faces[i]);
appendStringInfo(sql,
- "%lld id, ST_SetSRID(ST_MakeEnvelope(%g,%g,%g,%g),%d) mbr",
+ "%" PRId64 " id, ST_SetSRID(ST_MakeEnvelope(%g,%g,%g,%g),%d) mbr",
face->face_id, face->mbr->xmin, face->mbr->ymin,
face->mbr->xmax, face->mbr->ymax, topo->srid);
}
}
appendStringInfo( sql, " FROM \"%s\".relation r %s topology.layer l WHERE "
"l.topology_id = %d AND l.level = 0 AND l.layer_id = r.layer_id "
- "AND abs(r.element_id) = %lld AND r.element_type = 2",
+ "AND abs(r.element_id) = %" PRId64 " AND r.element_type = 2",
topo->name, (new_edge2 == -1 ? "," : "USING" ), topo->id, split_edge );
if ( new_edge2 != -1 ) {
appendStringInfo(sql, " RETURNING %s", proj);
resetStringInfo(sql);
appendStringInfo(sql,
"INSERT INTO \"%s\".relation VALUES ("
- "%d,%d,%lld,%d)", topo->name,
+ "%d,%d,%" PRId64 ",%d)", topo->name,
topogeo_id, layer_id, negate ? -new_edge1 : new_edge1, element_type);
spi_result = SPI_execute(sql->data, false, 0);
if ( spi_result != SPI_OK_INSERT ) {
resetStringInfo(sql);
appendStringInfo(sql,
"INSERT INTO FROM \"%s\".relation VALUES ("
- "%d,%d,%lld,%d", topo->name,
+ "%d,%d,%" PRId64 ",%d", topo->name,
topogeo_id, layer_id, negate ? -new_edge2 : new_edge2, element_type);
spi_result = SPI_execute(sql->data, false, 0);
if ( spi_result != SPI_OK_INSERT ) {
const char *proj = "r.element_id, r.topogeo_id, r.layer_id, r.element_type";
POSTGIS_DEBUGF(1, "cb_updateTopoGeomFaceSplit signalled "
- "split of face %lld into %lld and %lld",
+ "split of face %" PRId64 " into %" PRId64
+ " and %" PRId64,
split_face, new_face1, new_face2);
initStringInfo(sql);
}
appendStringInfo( sql, " FROM \"%s\".relation r %s topology.layer l WHERE "
"l.topology_id = %d AND l.level = 0 AND l.layer_id = r.layer_id "
- "AND abs(r.element_id) = %lld AND r.element_type = 3",
+ "AND abs(r.element_id) = %" PRId64 " AND r.element_type = 3",
topo->name, (new_face2 == -1 ? "," : "USING" ), topo->id, split_face );
if ( new_face2 != -1 ) {
appendStringInfo(sql, " RETURNING %s", proj);
resetStringInfo(sql);
appendStringInfo(sql,
"INSERT INTO \"%s\".relation VALUES ("
- "%d,%d,%lld,%d)", topo->name,
+ "%d,%d,%" PRId64 ",%d)", topo->name,
topogeo_id, layer_id, negate ? -new_face1 : new_face1, element_type);
POSTGIS_DEBUGF(1, "cb_updateTopoGeomFaceSplit query: %s", sql->data);
resetStringInfo(sql);
appendStringInfo(sql,
"INSERT INTO \"%s\".relation VALUES ("
- "%d,%d,%lld,%d)", topo->name,
+ "%d,%d,%" PRId64 ",%d)", topo->name,
topogeo_id, layer_id, negate ? -new_face2 : new_face2, element_type);
POSTGIS_DEBUGF(1, "cb_updateTopoGeomFaceSplit query: %s", sql->data);