# Forum

### Author Topic: Coordinate System Problem  (Read 4620 times)

#### NougierEva

• Newbie
• Posts: 12
##### Coordinate System Problem
« on: December 06, 2017, 04:13:23 PM »
Dear everyone,

I have a realy problem with my coordinate of my projet in my python script  .
My goal is to precise the coordinate of my GCP file.
How to specify the coordinate system of the GCP file ?

Or can you give me a link where there is informations about coordinate system of a CSV file ?

My script is in attached file,

Have a nice end of week,

Eva

#### LFSantosgeo

• Jr. Member
• Posts: 70
##### Re: Coordinate System Problem
« Reply #1 on: December 06, 2017, 08:10:15 PM »
Dear everyone,

I have a realy problem with my coordinate of my projet in my python script  .
My goal is to precise the coordinate of my GCP file.
How to specify the coordinate system of the GCP file ?

Or can you give me a link where there is informations about coordinate system of a CSV file ?

My script is in attached file,

Have a nice end of week,

Eva

Eva, I did the following to solve my coordinate system problem.

Code: [Select]
`   print('Converting project to GCP coordinate system')   chunk = doc.chunk   #new coordinate system: substitute for the EPSG code of interest   n_crs = PhotoScan.CoordinateSystem("EPSG::31983")   for camera in chunk.cameras:      camera.reference.location = PhotoScan.CoordinateSystem.transform(camera.reference.location, chunk.crs, n_crs)`
Hope it helps despite not actually being done by selecting in a drop-down menu. And the best guy to help you out is Alexey.
« Last Edit: December 06, 2017, 09:50:13 PM by lfsantosgeo »
Luiz Fernando

#### NougierEva

• Newbie
• Posts: 12
##### Re: Coordinate System Problem
« Reply #2 on: December 07, 2017, 01:07:03 PM »

But I would like to ask the user to specify the coordinate sytem and it doesn't work.
In my script, I put this sentences. It doesn't make errors but the coordinate system of my chunk doesn't change.

n_crs = PhotoScan.app.getCoordinateSystem("Sélectionner le système de coordonnées", doc.chunk.crs)
doc.chunk.crs = n_crs

Is it possible to create a list with the coordinate sytem and ask the user to choose in this list ?

Thanks,
Eva

#### LFSantosgeo

• Jr. Member
• Posts: 70
##### Re: Coordinate System Problem
« Reply #3 on: December 07, 2017, 01:45:43 PM »
Eva, try this code:

Code: [Select]
`   print('Converting project to GCP coordinate system')   chunk = doc.chunk   #new coordinate system: substitute for the EPSG code of interest   #n_crs = PhotoScan.CoordinateSystem("EPSG::31983") #enable if you want to set without prompt drop-down menu   n_crs = PhotoScan.app.getCoordinateSystem("Select Coordinate System", doc.chunk.crs) #enable if you want a prompt to choose coordinate system from drop-down menu   for camera in chunk.cameras:      camera.reference.location = PhotoScan.CoordinateSystem.transform(camera.reference.location, chunk.crs, n_crs)   #Update   PhotoScan.app.update()`
For me this works. Don't know if it will with your workflow.
Luiz Fernando

#### Alexey Pasumansky

• Agisoft Technical Support
• Hero Member
• Posts: 14890
##### Re: Coordinate System Problem
« Reply #4 on: December 07, 2017, 02:21:40 PM »
Hello Eva,

What is not working?

Can you add print(n_crs) command after the system selection?
Best regards,
Alexey Pasumansky,
Agisoft LLC

#### NougierEva

• Newbie
• Posts: 12
##### Re: Coordinate System Problem
« Reply #5 on: December 07, 2017, 07:45:36 PM »

I have finally resolved my problem.
Now my chunk has the coordinate system precise by the user at the begining of my script.
I try my script with 30 images and the script work weel, no error was mention in the command box.
Nevertheless, I don't arrive to see my sparse point cloud or my dense point cloud on the main window until I press the buton save when my script is finished.

I put in attached file my script. I can't put my PhotoScan project because it's too large.
Do you know why I have this strange problem ?

Really thanks for your usefull help,
I'm really sorry to annoy you with all my questions,

Thanks,
Eva

#### Alexey Pasumansky

• Agisoft Technical Support
• Hero Member
• Posts: 14890
##### Re: Coordinate System Problem
« Reply #6 on: December 07, 2017, 08:00:39 PM »
Hello Eva,

What happens, if you press Reset View button on the toolbar after the script finishes?
Best regards,
Alexey Pasumansky,
Agisoft LLC

#### NougierEva

• Newbie
• Posts: 12
##### Re: Coordinate System Problem
« Reply #7 on: December 11, 2017, 12:12:05 PM »
Hi,

I didn't see my point cloud because the error on the GCP for my new test was really high. I don't know why, bceause I don't change anything...
I have two more questions :
- how to save a dense point cloud ? I try this sentence but it doesn't work. In my folder I have not my point cloud.
My sentence :
# Sauver le nuage de points
chunk.exportPoints(project_path,binary=True, precision=6, normals=False, colors=True, format = PhotoScan.PointsFormatE57)

- When I try my script with a little project(13 images), my point cloud appear, my target is at their good place but I can't see the error in meters on the GCP, only the error in pixel. I can't see also the coordinate of my GCP. It's the first time I have this kind of problem. Do you know why ? To be more precise and to undersant what I mean, I put a picture in attached file to show this. My script doesn't change anymore.

Thanks a lot for your help,
Have a nice day,
Eva

#### Alexey Pasumansky

• Agisoft Technical Support
• Hero Member
• Posts: 14890
##### Re: Coordinate System Problem
« Reply #8 on: December 11, 2017, 12:18:32 PM »
Hello Eva,

No error values for the markers likely means that there are no source coordinates (coordinate import doesn't work).

As for the dense cloud export, you need to use valid export path, including the file name and proper extension. Also I can suggest to use source argument: source = PhotoScan.DataSource.DenseCloudData.
Best regards,
Alexey Pasumansky,
Agisoft LLC