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

Using Squaring class of the algo module #19

Open
anarchz opened this issue Feb 4, 2022 · 0 comments
Open

Using Squaring class of the algo module #19

anarchz opened this issue Feb 4, 2022 · 0 comments

Comments

@anarchz
Copy link

anarchz commented Feb 4, 2022

Hello!
I've tried to use class Squaring of the algo module for building squaring from .geojson file, but doesn't understand where I made a mistake. I would appreciate if you could help me.

Collection<Feature> units = GeoData.getFeatures(inFile);
Collection<Geometry> modyfiyedGeometry = new ArrayList<>();
if (inFile != null && !"".equals(inFile)) {
    for (Feature feature : units) {
        Collection<Polygon> polygons = JTSGeomUtil.getPolygons(feature.getGeometry());
        for (Polygon p : polygons) {
            modyfiyedGeometry.add(Squarring.get(p));
        }
    }
}

units = FeatureUtil.geometriesToFeatures(modyfiyedGeometry);
GeoData.save(units, outFile, GeoData.getCRS(inFile));
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

No branches or pull requests

1 participant