Git Product home page Git Product logo

orbisanalysis's Introduction

OrbisAnalysis

A repository to collect all OrbisGIS processes for spatial analysis

orbisanalysis's People

Contributors

ebocher avatar elsw56 avatar spalominos avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

orbisanalysis's Issues

OSM download when ' character

From orbisgis/geoclimate#352

There is trouble with the downloading of cities having ' in its name (such as Montfort-l**'**Amaury or Le Plessis-l'Évêque).
The error message is the following:

[INFO] org.orbisgis.orbisanalysis.osm.utils.Utilities - https://nominatim.openstreetmap.org/search?q=Montfort-l%27Amaury&limit=5&format=geojson&polygon_geojson=1
[INFO] org.orbisgis.orbisanalysis.osm.utils.Utilities - Executing query... Montfort-l'Amaury
[INFO] org.orbisgis.orbisanalysis.osm.utils.Utilities - Downloading the Nominatim data.
[ERROR] org.orbisgis.orbisdata.processmanager.process.Process - Error while executing the process.
java.lang.IllegalStateException: Failed to process query. Unterminated ' character?
at groovy.sql.ExtractIndexAndSql.appendToEndOfString(ExtractIndexAndSql.java:145)

Fix poly query request

Run

    //@Test doesn't work here... POST method must be used
    void extractPlaceLoadTransformPolygonsFilteredPolyTest() 

Invalid polygon on border

See

SELECT st_makevalid('POLYGON ((598003.4849443114 5325978.288854313, 598019.7449348173 5325982.413495027, 598036.9966877099 5325985.176546716, 598042.8267686924 5325984.4979892755, 598046.4229000872 5325986.371658631, 598078.3655819619 5325991.34276151, 598083.8878627924 5325991.237100496, 598092.6227712187 5325992.776229829, 598096.3492982117 5325994.429808194, 598132.8710515047 5326000.424558396, 598137.6442693556 5325999.249950156, 598140.915042991 5325999.67281278, 598144.1441265537 5326002.096146798, 598163.6381410899 5326004.864608504, 598170.38531015 5326005.013471729, 598173.4626870117 5326000.196612171, 598184.5724560271 5325998.352295577, 598196.2420131462 5325997.318059992, 598205.3328128117 5325998.085218615, 598213.045235186 5325999.729315703, 598215.4667951063 5325986.6630382035, 598217.1775331628 5325972.906407454, 598219.3241563962 5325960.669248893, 598223.9881157577 5325968.92063883, 598228.4935074368 5325987.297530931, 598243.6522338333 5325996.117847299, 598268.7026505754 5326002.005880023, 598307.0470037074 5326017.70537465, 598323.2262882312 5326021.740560573, 598334.6636723676 5326022.514810426, 598335.0902894547 5326028.0476212725, 598407.4719685452 5326031.668556132, 598383.2103152417 5325844.341512322, 598399.2792301291 5325846.151465277, 598420.5409319543 5325732.493249696, 598424.7707265288 5325731.743135763, 598480.2760708437 5325737.821316522, 598508.1153171442 5325741.456893762, 598535.14038922 5325746.079210713, 598593.0807826507 5325761.316850651, 598649.7835026709 5325778.323745295, 598107.9648758237 5325707.836889621, 598109.7551539204 5325733.838410134, 598111.7318708443 5325763.311837929, 598100.7445987663 5325804.570569212, 598097.7537505792 5325822.618984062, 598084.9077483611 5325851.905560522, 598075.518004116 5325867.732179461, 598064.1509316695 5325885.481708668, 598052.6330608106 5325896.36907385, 598038.0839131859 5325907.204635104, 598026.5082231611 5325921.915542008, 598018.8355672884 5325935.370183012, 598011.6799352192 5325951.268441437, 598004.8439583599 5325968.517409957, 598004.2007638263 5325974.765667894, 598003.4849443114 5325978.288854313))'::geometry)

org.orbisgis.osm.Utilities case

org.orbisgis.osm.Utilities should be moved to org.orbisgis.osm.utils.Utilities or methods should be converted into Process.

OSM module broken !

It seems since the last OSM code refactoring, the OSM does'nt work anymore.

This real test case

@Test //disable. It uses for test purpose
    void dev() {
        H2GIS h2GIS = RANDOM_DS()
        Geometry geom = OSMTools.Utilities.getAreaFromPlace("Paimpol");

        def geomAndFilter = OSMTools.Utilities.buildGeometryAndZone(geom, -1, 0, h2GIS)

        geom = geomAndFilter.geom
        def  epsg = geom.getSRID()
        Geometry  filterArea =  geomAndFilter.filterArea

        def query = OSMTools.Utilities.buildOSMQuery(filterArea.getEnvelopeInternal(), [], OSMElement.NODE, OSMElement.WAY, OSMElement.RELATION)
        def extract = OSMTools.Loader.extract()
        if (!query.isEmpty()) {
            if (extract.execute(overpassQuery: query)) {
                def prefix = "OSM_FILE_${OSMTools.uuid}"
                def load = OSMTools.Loader.load()
                if (load(datasource: h2GIS, osmTablesPrefix: prefix, osmFilePath:extract.results.outputFilePath)) {

                    def tags = ['building']

                    def transform = OSMTools.Transform.toPolygons()
                    transform.execute(datasource: h2GIS, osmTablesPrefix: prefix, epsgCode: epsg, tags: tags)
                    assertNotNull(transform.results.outputTableName)
                    h2GIS.getTable(transform.results.outputTableName).save("/tmp/${transform.results.outputTableName}.shp")
                }
            }
        }
    }

returns

INFO] org.orbisgis.osm.TransformTest - @ dev()
[INFO] org.orbisgis.osm.Utilities - https://nominatim.openstreetmap.org/search?q=Paimpol&limit=5&format=geojson&polygon_geojson=1
[INFO] org.orbisgis.osm.Utilities - Executing query... Paimpol
[INFO] org.orbisgis.osm.Utilities - Downloading the Nominatim data.
[INFO] org.orbisgis.osm.Loader - Extract the OSM data
[INFO] org.orbisgis.osm.Loader - https://overpass-api.de/api/interpreter?data=%5Bbbox%3A4.396723860458536E-4%2C-7.488771707149357%2C4.4023670013310003E-4%2C-7.488770662716392%5D%3B%0A%28%0A%09node%3B%0A%09way%3B%0A%09relation%3B%0A%29%3B%0A%28._%3B%3E%3B%29%3B%0Aout%3B
[INFO] org.orbisgis.osm.Loader - Executing query... [bbox:4.396723860458536E-4,-7.488771707149357,4.4023670013310003E-4,-7.488770662716392];
(
	node;
	way;
	relation;
);
(._;>;);
out;
[ERROR] org.orbisgis.osm.Loader - Cannot execute the query.
Connected as: 34220848
Current time: 2019-12-20T12:48:59Z
Rate limit: 2
2 slots available now.
Currently running queries (pid, space limit, time limit, start time):

[ERROR] org.orbisgis.osm.Loader - Cannot extract the OSM data for the query [bbox:4.396723860458536E-4,-7.488771707149357,4.4023670013310003E-4,-7.488770662716392];
(
	node;
	way;
	relation;
);
(._;>;);
out;
[INFO] org.orbisgis.osm.TransformTest - # dev()

I would be nice to keep in the tests some real api usages, maybe for very small areas.

Headers

Add headers to the files.

Package name

Change package name into org.orbisgis.orbisanalysis.osm/osm-noise

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.