Exemplo n.º 1
0
        private OSMNode CreateDistrict(int index, District district)
        {
            OSMNode         returnNode      = null;
            DistrictManager districtManager = Singleton <DistrictManager> .instance;
            string          districtName    = districtManager.GetDistrictName(index);

            if (districtName != "")
            {
                Vector3           position = district.m_nameLocation;
                List <OSMNodeTag> tags     = new List <OSMNodeTag>();

                returnNode = CreateNode(unindexedNodeOffset++, position);

                tags.Add(new OSMNodeTag()
                {
                    k = "name", v = districtName
                });
                tags.Add(new OSMNodeTag()
                {
                    k = "place", v = "suburb"
                });

                returnNode.tag = tags.ToArray();
            }

            return(returnNode);
        }
Exemplo n.º 2
0
        private void ExportDistricts()
        {
            if (MapperOptionsManager.OptionChecked("districts", MapperOptionsManager.exportOptions))
            {
                DistrictManager districtManager = Singleton <DistrictManager> .instance;
                District[]      districts       = districtManager.m_districts.m_buffer;
                int             districtId      = 0;

                foreach (District district in districts)
                {
                    District.Flags districtFlags = district.m_flags;

                    if (districtFlags.IsFlagSet(District.Flags.Created))
                    {
                        OSMNode generatedNode = CreateDistrict(districtId, district);

                        if (generatedNode != null)
                        {
                            osmNodes.Add(generatedNode);
                        }
                    }

                    ++districtId;
                }
            }
        }
Exemplo n.º 3
0
        private OSMNode CreateNode(int index, Vector3 position)
        {
            OSMNode returnNode = null;
            decimal lon, lat;

            Translations.VectorToLonLat(position, out lon, out lat);

            returnNode = new OSMNode {
                changeset = 50000000, id = (uint)index, version = 1, timestamp = DateTime.Now, user = "******", lon = lon, lat = lat
            };

            return(returnNode);
        }
Exemplo n.º 4
0
        private void ExportNodes()
        {
            NetManager netManager = Singleton <NetManager> .instance;

            NetNode[] netNodes = netManager.m_nodes.m_buffer;
            int       nodeId   = 0;

            foreach (NetNode netNode in netNodes)
            {
                NetNode.Flags nodeFlags = netNode.m_flags;

                if (nodeFlags.IsFlagSet(NetNode.Flags.Created))
                {
                    OSMNode generatedNode = CreateNode(nodeId, netNode.m_position);

                    if (generatedNode != null)
                    {
                        osmNodes.Add(generatedNode);
                    }
                }

                ++nodeId;
            }
        }
Exemplo n.º 5
0
        private OSMNode CreateNode(int index, Vector3 position)
        {
            OSMNode returnNode = null;
            decimal lon, lat;

            Translations.VectorToLonLat(position, out lon, out lat);

            returnNode = new OSMNode { changeset = 50000000, id = (uint)index, version = 1, timestamp = DateTime.Now, user = "******", lon = lon, lat = lat };

            return returnNode;
        }
Exemplo n.º 6
0
 public void MapCoordinates(OSMNode node)
 {
     if (node != null)
     {
         Vector2 pos = Vector2.zero;
         GetPos(node.lon, node.lat, ref pos);
     }
 }