We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi everyone, how can i read shapefile with the geom is multipolygon and convert to array list polygon
thank you
The text was updated successfully, but these errors were encountered:
geomentry := (metaData.Shape).(*goShp.Polygon)
coords := [][]geom.Coord{} for i := int32(0); i < geomentry.NumParts; i++ { coord := []geom.Coord{} if i == 0 { if geomentry.NumParts > 1 { for _, point := range geomentry.Points[0:geomentry.Parts[i+1]] { coord = append(coord, []float64{point.X, point.Y}) } coords = append(coords, coord) } else { // 只有一个部分 for _, point := range geomentry.Points[0:] { coord = append(coord, []float64{point.X, point.Y}) } coords = append(coords, coord) } } else if i == geomentry.NumParts-1 { for _, point := range geomentry.Points[geomentry.Parts[i]:] { coord = append(coord, []float64{point.X, point.Y}) } coords = append(coords, coord) } else { for _, point := range geomentry.Points[geomentry.Parts[i]:geomentry.Parts[i+1]] { coord = append(coord, []float64{point.X, point.Y}) } coords = append(coords, coord) } } polygon := geom.NewPolygon(geom.XY).MustSetCoords(coords).SetSRID(4326)
Sorry, something went wrong.
No branches or pull requests
Hi everyone,
how can i read shapefile with the geom is multipolygon and convert to array list polygon
thank you
The text was updated successfully, but these errors were encountered: