fix for ogr-decode --line-width-column option.
When combined with the --line-width option, if the field is present, but has no value, gdal returns 0. Use the value from --line-width in this case.
This commit is contained in:
parent
cd0ee283c0
commit
55bfcd80e7
1 changed files with 14 additions and 0 deletions
|
@ -444,6 +444,9 @@ void processLayer(OGRLayer* poLayer,
|
||||||
int width=point_width;
|
int width=point_width;
|
||||||
if (point_width_field!=-1) {
|
if (point_width_field!=-1) {
|
||||||
width=poFeature->GetFieldAsInteger(point_width_field);
|
width=poFeature->GetFieldAsInteger(point_width_field);
|
||||||
|
if (width == 0) {
|
||||||
|
width=point_width;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
processPoint((OGRPoint*)poGeometry,work_dir,area_type_name,width);
|
processPoint((OGRPoint*)poGeometry,work_dir,area_type_name,width);
|
||||||
break;
|
break;
|
||||||
|
@ -453,6 +456,9 @@ void processLayer(OGRLayer* poLayer,
|
||||||
int width=point_width;
|
int width=point_width;
|
||||||
if (point_width_field!=-1) {
|
if (point_width_field!=-1) {
|
||||||
width=poFeature->GetFieldAsInteger(point_width_field);
|
width=poFeature->GetFieldAsInteger(point_width_field);
|
||||||
|
if (width == 0) {
|
||||||
|
width=point_width;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
OGRMultiPoint* multipt=(OGRMultiPoint*)poGeometry;
|
OGRMultiPoint* multipt=(OGRMultiPoint*)poGeometry;
|
||||||
for (int i=0;i<multipt->getNumGeometries();i++) {
|
for (int i=0;i<multipt->getNumGeometries();i++) {
|
||||||
|
@ -465,7 +471,11 @@ void processLayer(OGRLayer* poLayer,
|
||||||
int width=line_width;
|
int width=line_width;
|
||||||
if (line_width_field!=-1) {
|
if (line_width_field!=-1) {
|
||||||
width=poFeature->GetFieldAsInteger(line_width_field);
|
width=poFeature->GetFieldAsInteger(line_width_field);
|
||||||
|
if (width == 0) {
|
||||||
|
width=line_width;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (texture_lines) {
|
if (texture_lines) {
|
||||||
processLineStringWithTextureInfo((OGRLineString*)poGeometry,work_dir,area_type_name,width);
|
processLineStringWithTextureInfo((OGRLineString*)poGeometry,work_dir,area_type_name,width);
|
||||||
} else if (seperate_segments) {
|
} else if (seperate_segments) {
|
||||||
|
@ -480,7 +490,11 @@ void processLayer(OGRLayer* poLayer,
|
||||||
int width=line_width;
|
int width=line_width;
|
||||||
if (line_width_field!=-1) {
|
if (line_width_field!=-1) {
|
||||||
width=poFeature->GetFieldAsInteger(line_width_field);
|
width=poFeature->GetFieldAsInteger(line_width_field);
|
||||||
|
if (width == 0) {
|
||||||
|
width=line_width;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
OGRMultiLineString* multils=(OGRMultiLineString*)poGeometry;
|
OGRMultiLineString* multils=(OGRMultiLineString*)poGeometry;
|
||||||
for (int i=0;i<multils->getNumGeometries();i++) {
|
for (int i=0;i<multils->getNumGeometries();i++) {
|
||||||
if (texture_lines) {
|
if (texture_lines) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue