Importing CSV file with position and image paths

I have a CSV file which has three columns LAT, LONG and IMAGE_PATH (which points to the jpg image in the folder), i have around 12,000 records , how can i import that excel in cesium ? Any help will be much appreciated as i am stuck on this.

@Ammar_Khalil

I do not think that this is necessarily a Cesium-specific issue. My recommendation would be to use a third-party tool (or a script that you create) to convert the CSV file into a Cesium-compatible data type such as KML. From there, uploading the data to Cesium ion should be rather straightforward.

-Sam

I need a little guidance on how to do it ? if i convert csv to geojson just to draw points and then click on points will load the imagery from file system , or in other case is there anyway to serve the images from a web server as a layer ?

1 Like

@Ammar_Khalil

If I am understanding you correctly, either way, should work. Have you researched which data type you wish to import into Cesium ion? Here is a guide that covers our accepted data formats and their corresponding asset types:

As you can see, we do not accept CSV. This guide should help you make an informed decision. If you are planning on sticking with GeoJSON, then you should check out this sandcastle example.

As you can see, when you select the data from the viewer you are presented with an infobox. Maybe this would be a good place to present the imagery?

Here are some resources that might help you convert a CSV to GeoJSON:

You will still need to account for your image data. Maybe this can be handled in a JavaScript function? If you struggle with this part of the process, I suggest contacting the folks who developed these resources. They will have greater expertise on file-type conversions. Let me know if you have any other questions or concerns!

-Sam

Thanks so much for your support, here are the steps i followed, kindly tell me that am i going in right direction or not ?

1- Using QGIS i converted CSV to GeoJson, and kept image path as property.
2- Using Cesium.GeoJsonDataSource.Load , i loaded the file which contains around 12,000 records.
3- Iterating the records i created entities for each record, and assigned a property bag with next and back image paths.
4- Captured the click event of entity and launched a javascript based panoramic image viewer, by feeding in the current image path, the next image is displayed when user clicks on next button.

Now the question , whats the best way so i can navigate between next and previous images of each image, without searching the entity array.
Also, please let me know , am i doing it all the right way ?

@Ammar_Khalil

Thank you for sharing some more details on your project! From what I can tell, it looks like you are moving in the correct direction. I would stick with this path and invest a few more hours into ensuring that things are implemented efficiently.

As for the best way to select images from your entity array, this would depend on your use case and how important runtime and optimization are. Ultimately, I would have to take a close look at your code to say for certain. What is the current strategy that you are using?

Best,
Sam

Help Ammar,
Have you successfully placed 360 panoramic images to your Cesium scene?
Can you please tell something about this process.?