Skip to content

Commit

Permalink
🐛 Fix a bug caused by GDAL version inconsistency
Browse files Browse the repository at this point in the history
  • Loading branch information
cyang-kth committed Mar 17, 2020
1 parent 034351d commit 4e6bba2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ _deps
*.layout
.kdev4/
*.kdev4
.idea/

# log file
*.log
Expand Down
14 changes: 7 additions & 7 deletions src/geometry_type.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ LineString ogr2linestring(OGRLineString *line){
};

LineString ogr2linestring(OGRMultiLineString *mline){
if (mline->IsEmpty()) return {};
OGRGeometryCollection *lines = mline->toUpperClass();
OGRGeometry *line = lines->getGeometryRef(0);
int binary_size = line->WkbSize();
std::vector<unsigned char> wkb(binary_size);
line->exportToWkb(wkbNDR,&wkb[0]);
LineString l;
bg::read_wkb(wkb.begin(),wkb.end(),l.get_geometry());
if (!mline->IsEmpty() && mline->getNumGeometries()>0){
OGRGeometry *line = mline->getGeometryRef(0);
int binary_size = line->WkbSize();
std::vector<unsigned char> wkb(binary_size);
line->exportToWkb(wkbNDR,&wkb[0]);
bg::read_wkb(wkb.begin(),wkb.end(),l.get_geometry());
}
return l;
};

Expand Down

0 comments on commit 4e6bba2

Please sign in to comment.