Git Product home page Git Product logo

Comments (2)

JamesHovet avatar JamesHovet commented on July 18, 2024

Looks like there's something in that dataset that is giving gis:create-turtles-inside-polygon a hard time. The good news for you @EwoutH is that since you want the turtles you are creating to be in the center of the polygon, the old fashioned way of creating turtles from polygons (before I created gis:create-turtles-inside-polygon) still works for you! Try this for your setup-spots function:

to setup-spots
  ;; For each parking space, determine the centroid, convert to x,y coordinates (list with 2 elements),
  ;; and create a turtle in the center of that polygon
  foreach gis:feature-list-of parking-dataset [ this-vector-feature ->
    let center gis:centroid-of this-vector-feature
    let loc gis:location-of center

    if length loc >= 2 [
      create-spots 1 [
        setxy item 0 loc item 1 loc
        set AMENITY gis:property-value this-vector-feature "AMENITY"
      ]
    ]
  ]
end

from gis-extension.

EwoutH avatar EwoutH commented on July 18, 2024

Thanks for getting back! It's a bit less scalable when adding other property-values in the future, but in my case I can get it to work.

I generated my dataset using OpenStreetMap data collected on https://overpass-turbo.eu/, using the query:

[bbox:{{bbox}}];

area
  [amenity=parking];
/*added by auto repair*/
(._;>;);
/*end of auto repair*/

out;

In the case anyone wants to debug this.

from gis-extension.

Related Issues (20)

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.