Giter VIP home page Giter VIP logo

Comments (6)

Gonzalo-Mier avatar Gonzalo-Mier commented on September 27, 2024

If your reference point for the GPS is '(A, B)', and your UTM zone is 32N, then:

gps_ref = f2c.Point(A, B)
ref_xy = f2c.Transform.transform(gps_ref, "EPSG:4326", "UTM:32N datum:WGS84")
dubins_path.moveTo(ref_xy)
gps_path = f2c.Transform.transform(dubins_path, "UTM:32N datum:WGS84", "EPSG:4326")

from fields2cover.

ingmeca2018 avatar ingmeca2018 commented on September 27, 2024

@Gonzalo-Mier Thanks for your reply.
I got this error :

"ref_xy = f2c.Transform.transform(gps_ref, "EPSG:4326", "UTM:32N datum:WGS84")
TypeError: transform() takes 2 positional arguments but 3 were given"

I'm not sure, but also i think that the 1st argument of "Transform.transform" should be F2CField type (in my case i don't have a field).

Other question : As you see, every time i add a start.point and end.point to the path[i] to make a Line (example path0.addPoint( 5.0, -30.0), path0.addPoint( 0.0, 10.0))
Because in my application i should give them in GPS coordinates instead of (X,Y) like the simple example on top, adding the gps-ref to the code is the only change that should be done?

from fields2cover.

Gonzalo-Mier avatar Gonzalo-Mier commented on September 27, 2024

Sorry, the swig interface doesn't allow that yet. Recompile the f2c library, install it and try this:

gps_ref = f2c.Point(4.261999903178513,51.785970497504699)
field = f2c.Field()
field.setRefPoint(gps_ref)
f2c.Transform.transformToUTM(field)
path = f2c.Transform.transformToPrevCRS(dubins_path, field)

It should work now

from fields2cover.

ingmeca2018 avatar ingmeca2018 commented on September 27, 2024

@Gonzalo-Mier ,

Thanks, yes it works.
So, i can put directly the points of the swaths (path[i].addPoint(.....,.....) in the example) in gps coords ?

from fields2cover.

Gonzalo-Mier avatar Gonzalo-Mier commented on September 27, 2024

I don't understand what you want

from fields2cover.

Gonzalo-Mier avatar Gonzalo-Mier commented on September 27, 2024

I'll close the issue as it was solved. Feel free to open a new one if you have more doubts :)

from fields2cover.

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.