appendStringInfoChar(str, '(');
if ( fields & LWT_COL_EDGE_EDGE_ID ) {
if ( edge->edge_id != -1 )
- appendStringInfo(str, "%" PRId64, edge->edge_id);
+ appendStringInfo(str, "" INT64_FORMAT, edge->edge_id);
else
appendStringInfoString(str, "DEFAULT");
sep = ",";
}
if ( fields & LWT_COL_EDGE_START_NODE ) {
- appendStringInfo(str, "%s%" PRId64, sep, edge->start_node);
+ appendStringInfo(str, "%s" INT64_FORMAT, sep, edge->start_node);
sep = ",";
}
if ( fields & LWT_COL_EDGE_END_NODE ) {
- appendStringInfo(str, "%s%" PRId64, sep, edge->end_node);
+ appendStringInfo(str, "%s" INT64_FORMAT, sep, edge->end_node);
sep = ",";
}
if ( fields & LWT_COL_EDGE_FACE_LEFT ) {
- appendStringInfo(str, "%s%" PRId64, sep, edge->face_left);
+ appendStringInfo(str, "%s" INT64_FORMAT, sep, edge->face_left);
sep = ",";
}
if ( fields & LWT_COL_EDGE_FACE_RIGHT ) {
- appendStringInfo(str, "%s%" PRId64, sep, edge->face_right);
+ appendStringInfo(str, "%s" INT64_FORMAT, sep, edge->face_right);
sep = ",";
}
if ( fields & LWT_COL_EDGE_NEXT_LEFT ) {
- appendStringInfo(str, "%s%" PRId64, sep, edge->next_left);
+ appendStringInfo(str, "%s" INT64_FORMAT, sep, edge->next_left);
if ( fullEdgeData )
- appendStringInfo(str, ",%" PRId64, ABS(edge->next_left));
+ appendStringInfo(str, "," INT64_FORMAT, ABS(edge->next_left));
sep = ",";
}
if ( fields & LWT_COL_EDGE_NEXT_RIGHT ) {
- appendStringInfo(str, "%s%" PRId64, sep, edge->next_right);
+ appendStringInfo(str, "%s" INT64_FORMAT, sep, edge->next_right);
if ( fullEdgeData )
- appendStringInfo(str, ",%" PRId64, ABS(edge->next_right));
+ appendStringInfo(str, "," INT64_FORMAT, 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 %" PRId64, op, edge->edge_id);
+ appendStringInfo(str, "%s " INT64_FORMAT, op, edge->edge_id);
sep = sep1;
}
if ( fields & LWT_COL_EDGE_START_NODE ) {
appendStringInfo(str, "%sstart_node ", sep);
- appendStringInfo(str, "%s %" PRId64, op, edge->start_node);
+ appendStringInfo(str, "%s " INT64_FORMAT, op, edge->start_node);
sep = sep1;
}
if ( fields & LWT_COL_EDGE_END_NODE ) {
appendStringInfo(str, "%send_node", sep);
- appendStringInfo(str, "%s %" PRId64, op, edge->end_node);
+ appendStringInfo(str, "%s " INT64_FORMAT, op, edge->end_node);
sep = sep1;
}
if ( fields & LWT_COL_EDGE_FACE_LEFT ) {
appendStringInfo(str, "%sleft_face", sep);
- appendStringInfo(str, "%s %" PRId64, op, edge->face_left);
+ appendStringInfo(str, "%s " INT64_FORMAT, op, edge->face_left);
sep = sep1;
}
if ( fields & LWT_COL_EDGE_FACE_RIGHT ) {
appendStringInfo(str, "%sright_face", sep);
- appendStringInfo(str, "%s %" PRId64, op, edge->face_right);
+ appendStringInfo(str, "%s " INT64_FORMAT, op, edge->face_right);
sep = sep1;
}
if ( fields & LWT_COL_EDGE_NEXT_LEFT ) {
appendStringInfo(str, "%snext_left_edge", sep);
- appendStringInfo(str, "%s %" PRId64, op, edge->next_left);
+ appendStringInfo(str, "%s " INT64_FORMAT, op, edge->next_left);
sep = sep1;
if ( fullEdgeData ) {
appendStringInfo(str, "%s abs_next_left_edge", sep);
- appendStringInfo(str, "%s %" PRId64, op, ABS(edge->next_left));
+ appendStringInfo(str, "%s " INT64_FORMAT, op, ABS(edge->next_left));
}
}
if ( fields & LWT_COL_EDGE_NEXT_RIGHT ) {
appendStringInfo(str, "%snext_right_edge", sep);
- appendStringInfo(str, "%s %" PRId64, op, edge->next_right);
+ appendStringInfo(str, "%s " INT64_FORMAT, op, edge->next_right);
sep = sep1;
if ( fullEdgeData ) {
appendStringInfo(str, "%s abs_next_right_edge", sep);
- appendStringInfo(str, "%s %" PRId64, op, ABS(edge->next_right));
+ appendStringInfo(str, "%s " INT64_FORMAT, 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 %" PRId64, op, node->node_id);
+ appendStringInfo(str, "%s " INT64_FORMAT, 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, "%" PRId64, node->containing_face);
+ appendStringInfo(str, "" INT64_FORMAT, node->containing_face);
} else {
appendStringInfoString(str, "null::int");
}
if ( fields & LWT_COL_NODE_NODE_ID ) {
if ( node->node_id != -1 )
- appendStringInfo(str, "%" PRId64, node->node_id);
+ appendStringInfo(str, "" INT64_FORMAT, node->node_id);
else
appendStringInfoString(str, "DEFAULT");
sep = ",";
if ( fields & LWT_COL_NODE_CONTAINING_FACE ) {
if ( node->containing_face != -1 )
- appendStringInfo(str, "%s%" PRId64, sep, node->containing_face);
+ appendStringInfo(str, "%s" INT64_FORMAT, sep, node->containing_face);
else appendStringInfo(str, "%snull::int", sep);
}
addFaceValues(StringInfo str, LWT_ISO_FACE *face, int srid)
{
if ( face->face_id != -1 )
- appendStringInfo(str, "(%" PRId64, face->face_id);
+ appendStringInfo(str, "(" INT64_FORMAT, face->face_id);
else
appendStringInfoString(str, "(DEFAULT");
appendStringInfoString(sql, " WHERE edge_id IN (");
// add all identifiers here
for (i=0; i<*numelems; ++i) {
- appendStringInfo(sql, "%s%" PRId64, (i?",":""), ids[i]);
+ appendStringInfo(sql, "%s" INT64_FORMAT, (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%" PRId64, (i?",":""), ids[i]);
+ appendStringInfo(sql, "%s" INT64_FORMAT, (i?",":""), ids[i]);
}
appendStringInfoString(sql, ") OR end_node IN (");
// add all identifiers here
for (i=0; i<*numelems; ++i) {
- appendStringInfo(sql, "%s%" PRId64, (i?",":""), ids[i]);
+ appendStringInfo(sql, "%s" INT64_FORMAT, (i?",":""), ids[i]);
}
appendStringInfoString(sql, ")");
appendStringInfoString(sql, " WHERE left_face IN (");
// add all identifiers here
for (i=0; i<*numelems; ++i) {
- appendStringInfo(sql, "%s%" PRId64, (i?",":""), ids[i]);
+ appendStringInfo(sql, "%s" INT64_FORMAT, (i?",":""), ids[i]);
}
appendStringInfoString(sql, ") OR right_face IN (");
// add all identifiers here
for (i=0; i<*numelems; ++i) {
- appendStringInfo(sql, "%s%" PRId64, (i?",":""), ids[i]);
+ appendStringInfo(sql, "%s" INT64_FORMAT, (i?",":""), ids[i]);
}
appendStringInfoString(sql, ")");
appendStringInfoString(sql, " WHERE face_id IN (");
// add all identifiers here
for (i=0; i<*numelems; ++i) {
- appendStringInfo(sql, "%s%" PRId64, (i?",":""), ids[i]);
+ appendStringInfo(sql, "%s" INT64_FORMAT, (i?",":""), ids[i]);
}
appendStringInfoString(sql, ")");
initStringInfo(sql);
appendStringInfo(sql, "WITH RECURSIVE edgering AS ( "
- "SELECT %" PRId64
+ "SELECT " INT64_FORMAT
" as signed_edge_id, edge_id, next_left_edge, next_right_edge "
- "FROM \"%s\".edge_data WHERE edge_id = %" PRId64 " UNION "
+ "FROM \"%s\".edge_data WHERE edge_id = " INT64_FORMAT " 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 "
appendStringInfoString(sql, " WHERE node_id IN (");
// add all identifiers here
for (i=0; i<*numelems; ++i) {
- appendStringInfo(sql, "%s%" PRId64, (i?",":""), ids[i]);
+ appendStringInfo(sql, "%s" INT64_FORMAT, (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%" PRId64, (i?",":""), ids[i]);
+ appendStringInfo(sql, "%s" INT64_FORMAT, (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,
- "%" PRId64 " id, ST_SetSRID(ST_MakeEnvelope(%g,%g,%g,%g),%d) mbr",
+ "" INT64_FORMAT " 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) = %" PRId64 " AND r.element_type = 2",
+ "AND abs(r.element_id) = " INT64_FORMAT " 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,%" PRId64 ",%d)", topo->name,
+ "%d,%d," INT64_FORMAT ",%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,%" PRId64 ",%d", topo->name,
+ "%d,%d," INT64_FORMAT ",%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 ) {
}
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) = %" PRId64 " AND r.element_type = 3",
+ "AND abs(r.element_id) = " INT64_FORMAT " 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,%" PRId64 ",%d)", topo->name,
+ "%d,%d," INT64_FORMAT ",%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,%" PRId64 ",%d)", topo->name,
+ "%d,%d," INT64_FORMAT ",%d)", topo->name,
topogeo_id, layer_id, negate ? -new_face2 : new_face2, element_type);
POSTGIS_DEBUGF(1, "cb_updateTopoGeomFaceSplit query: %s", sql->data);
initStringInfo(sql);
appendStringInfo(sql, "DELETE FROM \"%s\".face WHERE face_id IN (", topo->name);
for (i=0; i<numelems; ++i) {
- appendStringInfo(sql, "%s%" PRId64, (i?",":""), ids[i]);
+ appendStringInfo(sql, "%s" INT64_FORMAT, (i?",":""), ids[i]);
}
appendStringInfoString(sql, ")");