Skip to content

Commit

Permalink
dont expect leading " in WKTs, but support it optionally
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickbr committed Sep 27, 2024
1 parent cfda958 commit 5a0f4d0
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/qlever-petrimaps/GeomCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,11 @@ void GeomCache::parse(const char *c, size_t size) {
_qidToIdF.write(reinterpret_cast<const char *>(&idm),
sizeof(IdMapping));
_qidToIdFSize++;
} else if ((p = _dangling.rfind("\"POINT(", 0)) !=
} else if ((p = _dangling.rfind("POINT(", 1)) !=
std::string::npos) {
_curUniqueGeom++;
size_t i = 0;
p = parseMultiPoint(_dangling, p + 5, std::string::npos, &i);
p = parseMultiPoint(_dangling, p + 4, std::string::npos, &i);

// dummy element to keep sync
if (i == 0) {
Expand All @@ -184,11 +184,11 @@ void GeomCache::parse(const char *c, size_t size) {
sizeof(IdMapping));
_qidToIdFSize++;
}
} else if ((p = _dangling.rfind("\"MULTIPOINT(", 0)) !=
} else if ((p = _dangling.rfind("MULTIPOINT(", 1)) !=
std::string::npos) {
_curUniqueGeom++;
size_t i = 0;
p = parseMultiPoint(_dangling, p + 11, std::string::npos, &i);
p = parseMultiPoint(_dangling, p + 10, std::string::npos, &i);

// dummy element to keep sync
if (i == 0) {
Expand All @@ -198,11 +198,11 @@ void GeomCache::parse(const char *c, size_t size) {
sizeof(IdMapping));
_qidToIdFSize++;
}
} else if ((p = _dangling.rfind("\"LINESTRING(", 0)) !=
} else if ((p = _dangling.rfind("LINESTRING(", 1)) !=
std::string::npos) {
_curUniqueGeom++;
size_t i = 0;
p = parseMultiLineString(_dangling, p + 10, std::string::npos, &i);
p = parseMultiLineString(_dangling, p + 9, std::string::npos, &i);

// dummy element to keep sync
if (i == 0) {
Expand All @@ -212,11 +212,11 @@ void GeomCache::parse(const char *c, size_t size) {
sizeof(IdMapping));
_qidToIdFSize++;
}
} else if ((p = _dangling.rfind("\"MULTILINESTRING(", 0)) !=
} else if ((p = _dangling.rfind("MULTILINESTRING(", 1)) !=
std::string::npos) {
_curUniqueGeom++;
size_t i = 0;
p = parseMultiLineString(_dangling, p + 16, std::string::npos, &i);
p = parseMultiLineString(_dangling, p + 15, std::string::npos, &i);

// dummy element to keep sync
if (i == 0) {
Expand All @@ -226,11 +226,11 @@ void GeomCache::parse(const char *c, size_t size) {
sizeof(IdMapping));
_qidToIdFSize++;
}
} else if ((p = _dangling.rfind("\"POLYGON(", 0)) !=
} else if ((p = _dangling.rfind("POLYGON(", 1)) !=
std::string::npos) {
_curUniqueGeom++;
size_t i = 0;
p = parsePolygon(_dangling, p + 8, std::string::npos, &i);
p = parsePolygon(_dangling, p + 7, std::string::npos, &i);

// dummy element to keep sync
if (i == 0) {
Expand All @@ -240,11 +240,11 @@ void GeomCache::parse(const char *c, size_t size) {
sizeof(IdMapping));
_qidToIdFSize++;
}
} else if ((p = _dangling.rfind("\"MULTIPOLYGON(", 0)) !=
} else if ((p = _dangling.rfind("MULTIPOLYGON(", 1)) !=
std::string::npos) {
_curUniqueGeom++;
size_t i = 0;
p = parseMultiPolygon(_dangling, p + 13, std::string::npos, &i);
p = parseMultiPolygon(_dangling, p + 12, std::string::npos, &i);

// dummy element to keep sync
if (i == 0) {
Expand All @@ -254,10 +254,10 @@ void GeomCache::parse(const char *c, size_t size) {
sizeof(IdMapping));
_qidToIdFSize++;
}
} else if ((p = _dangling.rfind("\"GEOMETRYCOLLECTION(", 0)) !=
} else if ((p = _dangling.rfind("GEOMETRYCOLLECTION(", 1)) !=
std::string::npos) {
_curUniqueGeom++;
p += 19;
p += 18;

std::vector<size_t> starts = getGeomStarts(_dangling, p);

Expand Down

0 comments on commit 5a0f4d0

Please sign in to comment.