Hi,

 Jut to clarify my doubt, my shapefile has over 3000 features. So my 'SimpleFeatureSource' is getting populated with the features. Now, the shapefile that I am uploading is of a road network. So, I suppose the 'generator' is not getting populated because the features are not of the type 'LineSegment' probably as the 'add' method of a 'generator' takes a 'LineSegment' as its parameter.
 Please suggest me the possible workaround for this.

Thank You.
Harshad Shrikhande
Researcher R&D
TCS Innovations Infra Lab, Chennai
Tata Consultancy Services
Cell:- 7200605821
Mailto: harsha...@tcs.com
Website: http://www.tcs.com
____________________________________________
Experience certainty. IT Services
Business Solutions
Outsourcing
____________________________________________

-----Forwarded by Harshad S/TVM/TCS on 09/29/2011 03:18PM -----
To: geotools-gt2-users@lists.sourceforge.net
From: Harshad S <harsha...@tcs.com>
Date: 09/29/2011 02:40PM
Subject: [Geotools-gt2-users] Reg Graph Issues in Geotools

Hi,
         I am new to Geotools and its graph plugin. I am trying to find the shortest path between 2 points on a map. Following is the code for it. But there's an issue as the graph is not getting constructed from the shapefile and thus the 'generator' variable shows NULL value.


  1)  File file = JFileDataStoreChooser.showOpenFile("shp", null)
  2)  FileDataStore store = null;
  3)  store = FileDataStoreFinder.getDataStore(file);
  4)  SimpleFeatureSource featureSource = store.getFeatureSource()
  5)  LineGraphGenerator generator = new BasicLineGraphGenerator ()
  6)  SimpleFeatureCollection fc = featureSource.getFeatures();
        fc.accepts(new FeatureVisitor() {
           
            public void visit(Feature arg0) {
                // TODO Auto-generated method stub
            generator.add(arg0)    ;
            }
        }, null);
 
 Now, the generator is not getting populated with the graph from the shapefile. Please correct me I am missing something here.
       

Thank You.
Harshad Shrikhande
Researcher R&D
TCS Innovations Infra Lab, Chennai
Tata Consultancy Services
Cell:- 7200605821
Mailto: harsha...@tcs.com
Website: http://www.tcs.com
____________________________________________
Experience certainty. IT Services
Business Solutions
Outsourcing
____________________________________________
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you



------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to