Python Forum
code for finding a cables crossed the bondary of the city - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: code for finding a cables crossed the bondary of the city (/thread-23324.html)



code for finding a cables crossed the bondary of the city - spider_pytthon - Dec-22-2019

HI All ,

i have a map of a city and this map contains of lots of station that we are usind for distributing medium and low voltages cables for electricity .
i want to write a code to know which cables are crossed the boundary of the city and gives this cables red colour then i want to know which station connected to this cables and another code to know how many cables get out of each station in the map.

i have coordinate of this city and coordinate of the station but is it possible,do we have code to find all stations in the city without giving it coordinate just a name of a general name for station and he find it by itself.

Thanks alot


RE: code for finding a cables crossed the bondary of the city - Larz60+ - Dec-22-2019

Please clarify


RE: code for finding a cables crossed the bondary of the city - spider_pytthon - Dec-23-2019

I am looking for a method to find which line is intersecting with border of the map .and give this line special colour

i have cad file for city i want from my code to read it and output show me which line intersects with border (polygons) ,with red colour abd tell me also which device that this line connected to .

(Dec-23-2019, 08:07 AM)spider_pytthon Wrote: I am looking for a method to find which line is intersecting with border of the map .and give this line special colour

i have cad file for city i want from my code to read it and output show me which line intersects with border (polygons) ,with red colour and tell me also which block (station) that this line connected to . and if is it possible ,to know how many cable in and output from the block (station)

[Image: dtTsrRq]

As you can see, but it is cad file but just i draw it by hand to see what i need exactly.
Thanks alot



RE: code for finding a cables crossed the bondary of the city - Larz60+ - Dec-23-2019

what is the file format?
shapefile? or something like:
example assuming openstreetmap please correct in incorrect:
  • OSM XML
  • PBF Format
  • o5m
  • overpass JSON
  • osm4j



RE: code for finding a cables crossed the bondary of the city - spider_pytthon - Dec-23-2019

file format
DGN Cad file

it is a map for the city that has streets ,lot of cables distributed inside the street but i need to knwo only whichcables get out of this city .Thanks alot for help


RE: code for finding a cables crossed the bondary of the city - Larz60+ - Dec-23-2019

Well, obviously this is not my field, but I am quite familiar with mapping using shapefiles.
google 'find points where DGN file cables cross city boundaries'
brings up a lot of manuals for various DNG user guides, and a quick look through seems to find areas where boundary crossing can be coloured as you wish, one such document is Bentley Communications Fiber, on page 3-9.

Perheps what you seek can be found here.


RE: code for finding a cables crossed the bondary of the city - spider_pytthon - Dec-23-2019

Thanks for replyong but if we convert dgn format to shape file so i can use python code .
i want to do it by python code ,could u help me how it looks like the code if it is possible .Thanks alot


RE: code for finding a cables crossed the bondary of the city - Larz60+ - Dec-24-2019

Not suggesting converting to shapefile. I was just mentioning what I am familiar with.
The link and suggestion have nothing to do with shapefiles.


RE: code for finding a cables crossed the bondary of the city - spider_pytthon - Dec-24-2019

i have read that python support dxf so i can convert to dxf files if u can provide me with the code that can help me or any format u r familiar with ,i need to know how it looks like the code .thanks alot but i have a read about documentation thanks alot but i had to do lots of programming not only this so it will not happen without python ,programming code bcawhat i have asked about it is the beginning of my code .
so if that possible ,could you think we can convert my format to any format u r familiar with and explain for me how it looks like the code but only with bentley software no it will not be useful for me .i need to do it by python i mean u can explain ´the idea of any shapee of any format u r familiar with and write to me the code i need it necessary .thanks alot