Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the potential risk of shape and a Error of OgrLayer #161

Closed
wants to merge 1 commit into from

Conversation

wangxiya
Copy link

Update the Error of OgrLayer::LoadShapefile()
and
The potential risk of shape.importfromwkt()

Copy link
Contributor

@jerryfaust jerryfaust left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding the validation of the Shape Type, I believe it is already accounted for as you step into the Layer2Shapefile call. which in turn calls CreateShapeFile, which includes the following code:

ShpfileType shpType = OgrConverter::GeometryType2ShapeType(layer->GetGeomType());

// in case it's not strongly typed, let's check if use specified the type
if (shpType == SHP_NULLSHAPE)
{
	shpType = activeShapeType;
}

This already accomplishes what you have provided. So although what you suggest is valid, I believe it is already accounted for.

Do you agree?

@jerryfaust
Copy link
Contributor

Please review my comment regarding your change related to Issue #160, which I do not believe is necessary.

The second change you submitted, which relates to GitHub issue #159 (not #158 as listed above), looks like a good change that I will integrate. Thank you.

@wangxiya
Copy link
Author

wangxiya commented May 4, 2019

Regarding the validation of the Shape Type, I believe it is already accounted for as you step into the Layer2Shapefile call. which in turn calls CreateShapeFile, which includes the following code:

ShpfileType shpType = OgrConverter::GeometryType2ShapeType(layer->GetGeomType());

// in case it's not strongly typed, let's check if use specified the type
if (shpType == SHP_NULLSHAPE)
{
	shpType = activeShapeType;
}

This already accomplishes what you have provided. So although what you suggest is valid, I believe it is already accounted for.

Do you agree?

Yes! Very good! thanks !

@wangxiya wangxiya closed this May 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants