ThinkGeo.com    |     Documentation    |     Premium Support

In appropriate loading of the root file

hello everyone,
i am currently loading a shape file of route file from japan to canada . but the half route comes in one part where as the other part is on the other part the there is a line joining these two points.the image of the above is give below.can this can be avoided ?.i have switched on the warping mode.

regards,
hrishikesh

Hi hrishikesh,

It looks you failed to upload the attachment file, and I don’t understand your scenario from the description, if possible could you please built a sample with your test data? Or some screen shots, code snippet or video is helpful.

Regards,

Ethan

hello everyone,
the current scenario is shown in the image shown below.here half of the route is drawn .we want to connect route across the date line.


regards,
hrishikesh

Hi hrishikesh,

If you want to make them connect, you should want to find a point which is in the dateline, please view attached sample:

8938.zip (101.2 KB)

Wish that’s helpful.

Regards,

Ethan

hello,
what if we want to draw an line in such a way that there is no point on date line.but a points available before and after dateline?
regards,
hrishikesh

Hi Hrishikesh,

I am not understanding what’s your requirements. Could you please make it clear? and then we can help you out your issue.

Thanks
Mark

hello,
we want to load a route file for a ship which is from japan to Vancouver .the problem is that route is not displayed continuously across the date line. instead the result is some thing like this as shown below.


regards,
hrishikesh

Hi Hrishikesh,

Could you please let us know how you get the currently lines?

Are they existing lines from some data or dynamic calculated between two cities for example Tokyo and Vancouver?

If that’s calculated, you can switch one of the points to add 180 degree on its X value and then get a line which should works across dateline.

Regards,

Ethan

hello,
we are working on loading a route file externally the code for the following is given below.

List t = new List();

        foreach (var item in RouteLoader.Routes)
        {
            foreach (var point in item.Points)
            {

                var a = point.Latitude;
                var b = point.Longitude;
                Vertex v = new Vertex(b, a);

                t.Add(v);
            }


        }

        LineShape lineShape = new LineShape(t);
        testMap.TrackOverlay.TrackShapeLayer.Open();
        testMap.TrackOverlay.TrackShapeLayer.EditTools.BeginTransaction();
        testMap.TrackOverlay.TrackShapeLayer.EditTools.Add(new Feature(lineShape));
        testMap.TrackOverlay.TrackShapeLayer.EditTools.CommitTransaction();
        testMap.TrackOverlay.TrackShapeLayer.Close();
        testMap.TrackOverlay.TrackShapeLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = LineStyles.CreateSimpleLineStyle(new GeoColor(51, 153, 255), 2, false);
        testMap.TrackOverlay.TrackShapeLayer.WrappingExtent = testMap.Overlays["Diff0Overlay"].GetBoundingBox();
        testMap.TrackOverlay.TrackShapeLayer.WrappingMode = WrappingMode.WrapDateline; 

route loader is a list used for reading the data from file.
regards,
hrishikesh

Hi Hrishikesh,

I think that won’t works by load the route file, because you need to know which vertexes are in the left of dateline and which are in the right.

If you have the line shape of dateline, you can calculate and handle them, but from the Google map you can see the dateline is not a straight line, we also don’t have the line shape of it, so I am not sure whether you can do that follow this way.

If you can implement that by calculate the route, you can refer one of our sample, wish that’s helpful: http://wiki.thinkgeo.com/wiki/map_suite_desktop_edition_all_samples#great_circle_with_google_map

Regards,

Ethan

hello,
we changed the above code for loading a route file. and we have loaded the file across the date line by using the code shown below.

List t = new List();

        foreach (var item in RouteLoader.Routes)
        {
            foreach (var point in item.Points)
            {

                var a = point.Latitude;
                var b = point.Longitude;
                PointShape p = new PointShape(b, a);
                
                t.Add(p);

            }


        }



        PointShape p1 = null;
        PointShape p2;

   
        
       
        for (int i = 0; i < t.Count; i++)
        {
            if (i == 0)
            {
                p1 = t[i];
            }
            else
            {
                p2 = t[i];
                MultilineShape line = p1.GetShortestLineTo(p2, GeographyUnit.DecimalDegree);




                testMap.TrackOverlay.TrackShapeLayer.Open();
                testMap.TrackOverlay.TrackShapeLayer.EditTools.BeginTransaction();
                testMap.TrackOverlay.TrackShapeLayer.EditTools.Add(new Feature(line));
                testMap.TrackOverlay.TrackShapeLayer.EditTools.CommitTransaction();
                testMap.TrackOverlay.TrackShapeLayer.Close();



                p1 = p2;
            }

        }

but for the above code we are facing problem of editing the route . the screenshot of the problem is shown below.the editing points are missing and also on the other part of dateline

regards,
hrishikesh

Hi Hrishikesh,

You can see this line shows so many control points, that’s because your code cut the line to many segment, each part is a standalone feature and it have its control points, so you cannot handle it like a single feature.

If you want to handle it like a single feature, please try to add all the part into a MultilineShape and add this line into map.

Regards,

Ethan