Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to complete shapefile to road Shape? #65

Closed
white500 opened this issue May 28, 2024 · 7 comments
Closed

How to complete shapefile to road Shape? #65

white500 opened this issue May 28, 2024 · 7 comments
Assignees
Labels

Comments

@white500
Copy link

Hi,
I want to use the sdk to generate a road model. My raw data is a shapefile with the suffix ".shp". I know how to get the data in the shpfile, but I can't convert the lines in the shapefile into the required vertexCoords parameters. How is this process done, in which direction should I inquire, can you provide some cases in this regard, thank you very much!

@mistafunk
Copy link
Collaborator

Hi & thanks for your interest in our SDK.

Let me ask a few questions to better understand your situation:

  • I assume you read the shapefile and want to use prt::InitialShapeBuilder for each feature to create a prt::InitialShape and then run a RPK on it, correct?
  • Which library do you use to read the shapefile?
  • Which feature type do you want to read (lines, polygons, ...)?
  • What do you mean exactly with "I can't convert the lines"?

Best,
Simon

@mistafunk mistafunk self-assigned this Jun 4, 2024
@white500
Copy link
Author

white500 commented Jun 6, 2024

Thank you for your reply. Here is my answer:

  1. yes
  2. gdal
  3. lines
  4. I want to generate roads using rpk rules

The official example is not road network example, or is the sdk only able to generate buildings.

I want to convert the line data in.shp to the data in the image. Can I do that?
model

@mistafunk
Copy link
Collaborator

The algorithm which creates the street shapes (i.e. the input geometry for the procedural rules) from center lines is not part of the CityEngine SDK (PRT), it is part of the CityEngine desktop app itself.

To generate road models with CE SDK (PRT) you would need to export the "start" shapes (as you have them in above screenshot) created by CityEngine (including UV coordinates). Then you read this geo in your app, assign the corresponding RPK and generate.

@white500
Copy link
Author

white500 commented Jun 7, 2024

Should I use the export wavefront obj
image

@mistafunk
Copy link
Collaborator

Apologies for the late reply.

As road rules typically make use of texture coordinates and UV split (see e.g. /ESRI.lib/rules/Streets/Street_Modern_Standard.cga) it is best to use a format which can handle multiple UV sets. So I recommend to use FBX at this point.

@white500
Copy link
Author

Thanks for your reply. I'll try

@mistafunk
Copy link
Collaborator

Closing this for now - feel free to reopen in case there are problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants