Learn Python with Talk Python's 270 hours of courses

#295: GIS + Python Transcript

Recorded on Tuesday, Oct 27, 2020.

00:00 Geography of the Study of Places and Relationships Between People and Their Environments.

00:04 Often we think of maps, but maps are static.

00:07 GIS gets interesting when you realize that we're studying and visualizing data

00:11 flowing through these locations and communities.

00:13 In this episode, you'll meet Silas Toms.

00:15 He's an author of several Python GIS books and the co-host of the Mapist Hour podcast.

00:20 Are you ready to dive into GIS with Python?

00:23 This is Talk Python to Me, episode 295, recorded October 27th, 2020.

00:29 Welcome to Talk Python to Me, a weekly podcast on Python, the language, the libraries, the

00:46 ecosystem, and the personalities.

00:48 This is your host, Michael Kennedy.

00:50 Follow me on Twitter where I'm @mkennedy, and keep up with the show and listen to past

00:54 episodes at talkpython.fm, and follow the show on Twitter via at Talk Python.

00:59 This episode is brought to you by Linode and Talk Python Training.

01:02 Please check out the offers during their segments.

01:05 It really helps support the show.

01:06 At Talk Python, we run a bunch of web apps and web APIs.

01:11 These power the training courses as well as the mobile apps on iOS and Android.

01:15 If I had to build these from scratch again today, there's no doubt which framework I would

01:20 use.

01:20 It's FastAPI.

01:22 To me, FastAPI is the embodiment of modern Python and modern APIs.

01:26 You have beautiful usage of type annotations.

01:29 You have model binding and validation with Pydantic.

01:31 And you have first-class async and await support.

01:35 If you're building or rebuilding a web app, you owe it to yourself to check out our newest

01:40 course, Modern APIs with FastAPI over at Talk Python Training.

01:43 This is the first course in a series we're building on FastAPI.

01:47 And for just $39, it'll take you from interested to production with FastAPI.

01:52 To learn more and get started today, just visit talkpython.fm/fastapi or click the link

01:58 in your podcast player show notes.

02:00 Silas, welcome to Talk Python and me.

02:02 Oh, thank you so much for having me, Michael.

02:04 Yeah, it's great to have you.

02:05 Since this is a GIS episode, where are you calling in from?

02:09 Where are you located?

02:10 I'm in San Francisco, where I've lived for the last 13 years now, since I moved down for

02:15 grad school.

02:16 Oh, right on.

02:17 I grew up in Northern California, kind of in the middle of nowhere, but I always really

02:21 enjoyed this city and I've come to really love it.

02:24 Yeah, it's a neat place.

02:26 If you were to jump on I-5, the north-south major highway for people who don't know, and

02:30 go north for a very long time until the next big city you hit, you'd get to Portland,

02:34 where I am, so right on.

02:36 You know, I think Ashland's a big city.

02:37 You know, Ashland is nice to visit.

02:40 Yeah.

02:40 But if you could throw a rock across it, it's not a big city.

02:43 Yeah, there you go.

02:44 Yeah.

02:44 You can only have so much Shakespeare in your life.

02:46 Yeah.

02:47 Yeah, that's right.

02:47 That's right.

02:48 We're going to talk about GIS and Python and all those sorts of things, but a bunch of

02:53 cool job experiences that you've had, as well as some of the libraries and applications and

02:57 whatnot.

02:58 Well, let's start with the beginning.

02:59 How'd you get into programming in Python?

03:01 It was kind of a circuitous route.

03:03 I mean, my parents, of all things, were organic farmers up in the middle of nowhere when I was

03:08 born in Northern Humboldt County.

03:09 And my dad had always kind of had an interest in technology.

03:13 He wasn't averse or anything.

03:15 So when I was about eight, he got a little computer that was programmable that had a

03:20 basic program on it.

03:21 And so he used that to keep track of sales at our fruit stand.

03:25 Oh, right on.

03:26 And he taught me how to...

03:27 Yeah, it was cute.

03:29 And probably 800 lines or something, which seemed amazing to me.

03:32 Because he taught me how to do a little bit and I would do little silly things when I was

03:36 seven years old or whatever.

03:37 You know what's interesting about code is it's not always about how big or how complex it is.

03:42 Sometimes it's about what it empowers or the problem that it solves.

03:46 Like I can think of a couple of libraries and it's like, gosh, this is so nice this exists.

03:51 And it's like a hundred lines of code.

03:53 Yeah.

03:53 But I just love that it exists, you know?

03:55 Completely.

03:56 Like we'll get into it.

03:57 But like PyShape, it's an implementation reading shapefiles for geospatial data to format.

04:02 And it's relatively simple, compact, and it's beautiful.

04:05 I love it.

04:06 Yeah, for sure.

04:06 Okay.

04:07 So you had this experience with this basic app that was running the family business?

04:10 Yeah.

04:11 Well, there was that.

04:12 And then in high school, around 97, I took an elective in computer programming, also basic,

04:16 which I didn't like love the other crowd in the room, really.

04:20 I was always thinking of myself as a little more active.

04:22 I played sports, but I did like it.

04:24 I just, I couldn't fully identify with it.

04:26 And being from like a rural kind of macho county, like it just didn't occur to me that

04:32 that was something I could do.

04:34 And if you could see the future, like...

04:36 Yeah, yeah.

04:37 Now all the cool stuff you can build and like how sort of tech has changed in perception,

04:42 right?

04:42 Who knows?

04:42 Maybe it would have...

04:43 Well, maybe if I could just read the newspaper, because at that time, it was like the first dot-com

04:46 wave.

04:47 And I just wasn't really in the mindset that that was something I would do with my career.

04:51 But I went to college.

04:52 I went to Santa Cruz, and then I was kind of homesick.

04:55 I finished up back at Humboldt State University and got really into geography, which is a really

05:01 interesting quasi-science, I guess you'd say, that has a lot of really interesting theories

05:07 about why the world is, how it's divided up and why it's divided up the way it is.

05:11 How people sort of present themselves across space, how cultures interact with the physical

05:17 sciences.

05:18 And somebody who like spent my whole childhood like reading through encyclopedias, it was just

05:23 the best combination of learning and interests that I could ever find.

05:28 So without even realizing it, I had never heard of geography before I really got into college.

05:34 It was amazing.

05:35 It was perfect for me.

05:36 And it had this component that was, I think, a bit too lightly touched on called GIS, geospatial

05:42 information systems that I got exposed to.

05:46 And I thought it was kind of cool, but I wasn't, again, expecting to make computers a part of my

05:51 professional career at that time.

05:53 I was really focusing on environmental policy and water policy, especially.

05:57 Humboldt County has a lot more rain than the rest of California, and they've built these

06:01 giant dam systems to bring it down to the Central Valley.

06:04 And it seemed like there was a huge fish die-offs in 2001, 2002 that were directly attributed

06:11 to the lack of water.

06:12 And so I got kind of interested in like, how did they make these decisions to build these

06:16 dams?

06:16 Why does this water policy exist?

06:18 How did they benefit and value agriculture, like sort of profit or cotton that wasn't really

06:24 making a profit in the Central Valley versus salmon, which could be very valuable where I

06:29 was from.

06:29 So I got really deep into those weeds and ended up going into grad school in San Francisco

06:35 State for geography with a focus on resource management.

06:39 And that was 2007.

06:40 Nice.

06:41 And did you end up with like a lot of data?

06:43 Do you need a process?

06:44 You're like, all right, I guess I'm going to have to take out these computers again.

06:47 I just remember like late nights trying to figure out, like just really struggling with

06:52 the software and doing some interesting.

06:54 Also, another interest of mine was wine.

06:56 And I remember trying to do like a temperature map of Humboldt County because a lot of the

07:01 organic farming families that I'd grown up with had started growing wine at the time.

07:04 And I wanted to see like, how does it compare temperature-wise to Napa Valley or to other well-known

07:10 places?

07:11 And I just hated the manual data entry that I was doing.

07:15 And I thought, there's got to be a better way.

07:16 So those feelings and a couple internships that I got when I got to grad school really

07:22 led me to value programming.

07:25 And I felt so stupid with it at first because even though I'd had that experience as a child,

07:31 it had been a decade since I'd really touched a keyboard that way.

07:34 And I felt like there's got to be something to this.

07:38 So I'll just keep hitting my head against the wall.

07:40 And even though I feel kind of dumb, I know that I can use this.

07:43 And it really worked out.

07:44 Yeah, that's super cool.

07:46 I think it's really interesting in your story about how you kind of like slowly just dragged

07:51 you in.

07:51 And then you're like, fine, fine, you've got me.

07:54 I kind of went down the same path as you in some regards in that I didn't really see myself

07:59 as a developer.

08:00 I kept looking to do other things, chemistry and math and so on.

08:04 And eventually I just like, you know what?

08:05 Actually, I do like this better, but it's easy to forget those early days of like fighting

08:10 with the syntax.

08:11 Just, yeah, I remember being so excited about getting a C++ program to compile a little bit

08:17 right now.

08:17 It's going to have to run and work correctly.

08:20 That's the hard part.

08:20 Not the compiling, but these early days.

08:22 Yeah.

08:23 You step over these challenges and then they're kind of in the past.

08:26 But yeah, everyone goes through them.

08:27 Well, I remember when I was really trying to learn in 2008, I took a class that was sort of

08:32 an elective offered through the computer science department.

08:34 And I got to be really good friends with the guy who was just a master's in engineering student

08:39 himself.

08:39 And he really saw that I cared, even though I didn't know anything, basically.

08:43 And so he spent some time and taught me a bit of Django at that time, which was just coming

08:48 out.

08:48 And I remember getting so excited when I was able to have Django use ArcPy, talk to a shapefile,

08:55 get a location out and put it on a browser.

08:58 Just like a little tiny thing.

08:59 Yeah.

09:00 I showed my grandmother.

09:00 I'm like, grandma, I did it.

09:02 She had no idea what I was talking about.

09:06 I bet she was really happy to see it though.

09:09 She must've been psyched.

09:10 She didn't discourage me.

09:11 She was so excited.

09:12 But I just remember that moment of just like, I did it.

09:15 And the wizardry of that.

09:17 I still don't think I'm over that, really.

09:18 Yeah.

09:19 No, I haven't gotten over it either.

09:21 It's amazing.

09:21 And just that feeling of I built something that could be useful to people and it's out there

09:25 and they can play with it and then to see them come and use it is just amazing.

09:29 I started just that same process of like, whatever I could do at work.

09:35 Because at this point I had gotten a job as a GIS technician.

09:38 I was making maps of a park district lands that they were considering adding.

09:42 And I found it great to be paid, especially during the recession there.

09:46 But I was not like loving the work itself.

09:49 So I found all kinds of ways to use Python to automate, to figure out how to make like a database of all the other maps we had made to just anything that I could think of that was interesting to me.

09:59 I'm never going to enter a map a second time.

10:01 Yeah, exactly.

10:02 Stupid map.

10:04 So and then somewhere in there, I got a call from a recruiter.

10:08 I had some friends of friends who were in the program who knew that I did some Python and they recommended me for a job at an environmental consulting firm called ICF.

10:17 And the recruiter, I remember him saying like, do you really want to work for the government?

10:20 You know, you're like 27, right?

10:22 Yeah, I suppose you're right.

10:25 I was so happy to just have a steady job at that point that I wasn't actively looking, but there was some pull to just something different and exciting.

10:32 And I really benefited because it brought me into the opportunity to work on big environmental projects like the high-speed rail project and figure out how to use Python to automate those.

10:43 Because we were getting engineering outlines in AutoCAD and we had to convert that into GIS formats and then run that against all of the data we had on species range.

10:55 Or any kind of protected resource, even like farmland or wetlands or anything like that.

11:01 And we had to do it week after week after week.

11:03 And I was kind of, I just remember that first call when I first got hired where I was like, I think I can automate this.

11:09 Yeah.

11:10 With that upward tilt in my voice, but I could.

11:14 And I did.

11:15 That's awesome.

11:16 I kind of became a team.

11:17 And they probably saw you, like you said, as a wizard.

11:19 They're like, Silas can make it do it automatically.

11:22 Do you understand what that means?

11:24 On its own, right?

11:25 Like not other people.

11:26 Yeah.

11:26 And some of the libraries we're going to talk about in GIS are like, hey, I've got this lake and I've got this other thing.

11:32 Do they intersect?

11:33 Or does this line pass through this area?

11:37 And really interesting stuff that builds on common libraries that people will know like SQL.

11:41 Well, exactly.

11:42 You know, the one big one that really got me at that time, because I was running into like licensing issues with the Esri ArcGIS software that we were running, couldn't really do some of the higher level analyses I needed to do.

11:54 So I heard about this thing called PostGIS, which was built on top of what is it?

11:58 PostgreSQL and then a library called PsychoPG2 that allowed me to write spatial SQL and directly talk to a database and do those analyses in code like I had never been able to do before.

12:11 And it kind of blew my mind.

12:12 This is around 2010, 11 or something.

12:15 That's when I realized like beyond the world of the software that they had given me, this Esri software, there was this incredible open source software community that was providing tools that exactly the ones I needed.

12:28 And I can tweak them and do so much more and so much faster.

12:32 Yeah.

12:32 So interesting.

12:33 And you don't have to ask for licensing or worry about that or whatever.

12:39 This portion of Talk Python to me is sponsored by Linode.

12:41 Simplify your infrastructure and cut your cloud bills in half with Linode's Linux virtual machines.

12:46 Develop, deploy, and scale your modern applications faster and easier.

12:50 Whether you're developing a personal project or managing large workloads, you deserve simple, affordable, and accessible cloud computing solutions.

12:58 As listeners of Talk Python to me, you'll get a $100 free credit.

13:01 You can find all the details at talkpython.fm/Linode.

13:06 Linode has data centers around the world with the same simple and consistent pricing regardless of location.

13:11 Just choose the data center that's nearest to your users.

13:14 You'll also receive 24-7, 365 human support with no tiers or handoffs regardless of your plan size.

13:21 You can choose shared and dedicated compute instances, or you can use your $100 in credit on S3 compatible object storage,

13:28 managed Kubernetes clusters, and more.

13:31 If it runs on Linux, it runs on Linode.

13:34 Visit talkpython.fm/Linode or click the link in your show notes, then click that create free account button to get started.

13:41 All right.

13:44 Before we get off this sort of intro topic, though, really quick, what are you up to these days?

13:48 You've got a pretty interesting job working with an intersection of a lot of these concepts.

13:52 Well, yeah.

13:53 So, you know, that sort of like do-gooder mentality has never really gone away.

13:57 And I've worked on some big enterprise systems for a whole city, let's say,

14:02 which included creating a GIS for the Super Bowl for Levi's Stadium when it was here.

14:08 I got to go to the Super Bowl.

14:09 We did every concert and event for two years before that.

14:12 So, I saw Beyonce, you know, I saw Taylor Swift or all these people, right?

14:18 Just because I built a mapping system that used Python to talk to a 911 database to locate calls that were coming from the stadium.

14:25 And also, we figured out how to put an iPhone app in the pocket of the police so that we could see where they were.

14:30 And we could keep 70,000 drunk people from beating themselves up, you know?

14:35 And so, there was that.

14:37 But then, like, after that, I felt like I really wanted to just kind of go even more into front-end development and learn more JavaScript.

14:44 So, I ended up joining a team at NIO, which is, they've, like, shut down their U.S. operations, but it's a Chinese electric car company that's working on automatic cars and self-driving cars.

14:56 And that sparked a lot.

14:58 And that team that I worked with, I did leave and go to Zillow, which I'll get to in a bit.

15:02 But that team that I worked with, I loved.

15:04 And that team, one of the main guys, Josh Butler, founded this company, Kinetic Eye, which is, I think, the biggest realization from NIO, from all the work we did, all these smart people we worked with, is that,

15:14 self-driving cars is so hard.

15:17 And so, using computer vision, using machine learning, without, like, a really directed mission is going to be an incredibly hard thing to master for the next decade or so, even if you spend $10 billion on it.

15:30 I honestly can't believe we have self-driving cars.

15:33 It's, I always thought of the AI realm being like, oh, yeah, we're going to do this Turing test, and you're going to have the app chat with somebody over text.

15:42 And then, if it seemed real enough, your AI is, like, real.

15:45 And somehow, that always felt so shallow and fake.

15:48 And then, it was somehow kind of stagnated there.

15:50 And then, all of a sudden, cars are driving themselves around at a level of complexity so far beyond that they don't even compare, right?

15:58 And somehow, we couldn't quite get one, and we got this other.

16:00 I mean, yeah.

16:02 Tesla just rolled out their beta, right, last week or something.

16:05 Yeah, exactly.

16:06 It's advancing all the time.

16:07 I still felt like it was a huge problem, and level four, level five self-driving cars, which we were working towards, was going to be a decade off.

16:15 So, this team that split off, we're focused on computer vision in small spaces, in warehouses, to see, like, how safe are people being?

16:23 How much risk are people causing with their driving habits or with their work habits?

16:28 And how can we give business owners the ability to understand how safe the practices are at their work?

16:35 How much potential risk they have for, like, a worker's comp or an injury?

16:39 And the do-gooder in me loves it because, like, injuries just ripple out throughout a community.

16:44 If somebody is hurt, then they're out of work for a while.

16:47 Then their family is hurting.

16:48 Then their community is hurting.

16:49 And we really want to, like, have this use of computer vision that identifies intelligently risk and safety.

16:59 And so, it's a cool mission and also great technology.

17:01 Yeah.

17:02 So, if I had a factory and maybe after lunch, people would come back and they weren't putting on their hard hats.

17:07 Yeah.

17:07 Or something like that.

17:08 You would say, like, ah, we're missing some hard hats?

17:10 Something like that?

17:11 Yeah.

17:11 Yeah.

17:11 Yeah.

17:12 Hard hats, vests, masks.

17:14 Social distancing was one we built right away, obviously, when COVID hit.

17:17 Oh, yeah.

17:18 Of course, yeah.

17:19 And then forklift speeding, forklift near misses is really cool because we're able to plot it on a map, you know, like, brings it back to the map.

17:26 So, all those insane, like, YouTube videos of, like, people crashing, doing stupid stuff on, like, you know, work just after hours.

17:34 Like, you would know about that kind of stuff?

17:35 Yes, exactly.

17:37 You know, we're working towards, like, a real-time notification.

17:40 I think that that's in our future.

17:41 But more than anything, it's the all-the-time risk environment that we want to let people know about.

17:47 Like, how well are you doing and how safe are your people?

17:49 Sure.

17:50 Yeah, that sounds like a great mission.

17:51 Let's talk broadly about GIS for the moment.

17:55 Just some of the areas which have been used.

17:57 I mean, we talked a little bit about this with some of the environmental things you talked about.

18:02 I mean, I guess one of the things that most starkly stands out for me, maybe two, is one, is directions.

18:08 Like, another thing that I'm just blown away by.

18:11 Yeah.

18:12 And also, probably, like, a little bit weakened by, just as a human, is GPS.

18:16 The ability to ask Google Maps or something else how to get me there.

18:20 And just, I'm thinking of the feeling I have when I, for some reason, forgot my phone or the battery dies.

18:26 I'm just like, oh, I'm done.

18:28 Yeah.

18:28 What's going to happen now?

18:29 I have no GPS.

18:31 Right?

18:32 Whereas, like, I grew up without even a cell phone.

18:34 So, it's just such a weird thing.

18:36 But absolutely GPS, right?

18:37 Well, 20 years later, it's just become part of our lives.

18:40 Like, I remember in, like, 2001, let's say, trying to drive through San Francisco and being so freaked out, driving probably the longest way I could because it was the only route I knew to get safely from one side to the other.

18:52 And just couldn't imagine, you know, how easy it is today.

18:56 I went and visited my uncle who had gone to the Naval Academy.

18:59 And he was living in Annapolis in, like, 2005.

19:02 And I had some friends in D.C.

19:04 And I said, I'd like to go visit them.

19:05 How do I get down there?

19:06 And he's like, oh, well, there's GPS in my car.

19:08 So, you can just take my car.

19:09 And it will just tell you how to get there.

19:10 And I couldn't believe it.

19:11 It was just the easiest trip I'd ever had, door-to-door, in an area I had never visited in my life.

19:17 It blew my mind.

19:17 Yeah.

19:18 It's so amazing.

19:18 I remember doing some work in Shanghai.

19:20 And I had one of the early iPhones.

19:22 And I was using Google Maps.

19:24 I had gotten into the habit of, I'd sort of pick a random orientation.

19:27 I'm going to go that way for about an hour, walking and exploring.

19:31 And when I get tired, I'm going to just hit, take me back to my hotel.

19:33 And I had gotten really far one day.

19:36 And the phone was down to, like, 10%.

19:38 And I'm like, oh, my God.

19:39 I forgot the name of my hotel.

19:41 And I can't speak Chinese.

19:43 I can't speak Mandarin.

19:43 I'm going to be in really big trouble.

19:46 So, I had to just turn it off.

19:47 I'm like, please turn back on and get me close.

19:49 You know, like, that was the most extreme concern of lacking GPS.

19:53 But, yeah, certainly those things are amazing.

19:55 Another area that I think is really probably interesting, and maybe actually has a little more personal touch for you is agriculture, right?

20:03 Like, understanding your crops and growing things.

20:05 And just, you know, you think of sort of the idyllic farmer with just basic tools, right?

20:10 But there's a lot of IoT and a lot of smarts you can apply to those things now.

20:15 The marriage of GPS and GIS and farm tech is just all over, especially, let's say, the Midwest,

20:22 where they have, you know, one of the first self-driving applications was tractors, right?

20:26 Because it's so boring to just be in a tractor for a straight line for a long, long, long time and then turn around, right?

20:31 So, they figured out how to make the thing turn around using a satellite.

20:34 And it's pretty impressive.

20:35 I've always thought, too, that even, like, down to the small organic farms that I grew up with, you know,

20:40 where you're incredibly resource-specific, you need to know exactly what went where and keep track of it, you know, for regulations.

20:47 But also just to know what to grow next and to keep track of your nutrient levels in your soil,

20:52 that GIS and mapping would be a really great use.

20:56 I'm not sure how far it's gotten into there because a lot of them are kind of old-school hippies who don't, you know,

21:01 they still use pen and paper as much as possible.

21:03 But it's...

21:04 Maybe if you tell them it's open source and it's not corporate, they might accept it a little more.

21:07 They might love that, yeah.

21:08 So, yeah, it's become incredibly important.

21:11 And, you know, like just monitoring water levels, for instance, like, what do they call it?

21:17 NDVI, which is like how you can see how well your crops are watered or thriving

21:22 based on, like, the infrared that you can't see from the satellite imagery we can get now.

21:27 It's just incredible revelation, you know, and seeing that.

21:30 Yeah, I can imagine.

21:31 Yeah.

21:31 But then, you know, I kind of pulled away from that when I came down to the city

21:35 and got more into, like, environmental services, environmental industry.

21:39 And the two biggest projects I worked on was the high-speed rail, as I mentioned.

21:42 And then also the PG&E has power lines everywhere.

21:46 That's caused some issues because there's branches that have rubbed up on it and fires have started.

21:50 They have programs that monitor how much trimming they do around all of their lines throughout

21:56 all of Northern California, and they keep track of it.

21:58 And then they also have to kind of estimate within all that work how many, you know, endangered

22:02 species they stepped on accidentally, that kind of thing.

22:05 And because it's something that is expected work, they have to mitigate.

22:09 So, we would use GIS to calculate basically how much PG&E needed to pay.

22:14 The impact.

22:14 Yeah, the impact.

22:15 That was really cool.

22:17 The species animal equivalent of a carbon tax or carbon offset or something like that, right?

22:22 Yeah, pretty much.

22:24 Yeah.

22:24 It's just kind of how it goes.

22:25 The thing is, if they don't trim those lines, I mean, those fires are horrible this year.

22:32 And, you know, it's not like you could say, well, you just shouldn't trim them, right?

22:35 It's going to be worse, right?

22:36 It's like a necessary evil, basically.

22:38 Yeah, you have to do it.

22:39 I don't want to say I got disillusioned, but I realized in some ways that the industry

22:43 is, it's sort of just like insurance.

22:45 It's something, an expected business payment that you have to do to cover the effects of

22:50 your business, especially for those giant utilities or other large construction projects, which

22:55 is fine.

22:56 It maybe dampened my enthusiasm a bit.

22:58 But really, at that point, I was really getting excited by the technology.

23:02 It turns out I really like programming.

23:03 And I decided to move on to a company that was focused on city, like city GIS, like enterprise

23:12 GIS, being able to integrate, you know, the police with the sewers, with everything.

23:16 Because when we got there to that city, which is Santa Clara.

23:19 Basically building the smart city.

23:20 Smart city.

23:21 Yeah.

23:21 You know, they had like 11 different address databases that they were using.

23:25 Each department had their own and they were all different.

23:27 So like, imagine the police not knowing when you're at where your address is.

23:31 Well, it's more common than you would think, unfortunately.

23:34 Right.

23:34 And smart cities really appealed to me.

23:37 So I spent a couple of years doing that.

23:39 And that was amazing work.

23:41 But I just, again, really liked the programming so much.

23:44 I started moving away probably from pure GIS into a lot of like front end stuff.

23:50 But that kind of gave me an opportunity to get to know web mapping and JavaScript and all

23:55 the amazing JavaScript tools that have come out over the last 10 years to enable mapping

24:00 on the web.

24:00 Yeah.

24:01 So you worked at Zillow, for example, which is pretty awesome.

24:04 Yeah.

24:04 Zillow is definitely one of those cutting edge companies.

24:06 I remember being blown away when Zillow, when I first experienced Zillow, I'm like, I could

24:11 see what my neighbors paid for their house.

24:13 Yeah.

24:14 And the value, predicted value of it now.

24:16 And just like all that sort of neighborhood-y stuff.

24:20 Really interesting.

24:21 Yeah.

24:21 Well, when Zillow came out in like 2005, let's say, Esri really dominated the GIS space.

24:28 But you started to see these little cracks appear where like mashups, as they called them in the

24:33 late aughts.

24:34 That's right.

24:35 That was the web 2.0.

24:36 Yeah.

24:36 Mashups.

24:37 Mashups.

24:37 That was all the hype.

24:38 And in reality, you know, Zillow is just still a mashup.

24:43 It's a map with a data overlay of parcel information and some machine learning predictive algorithms,

24:50 I'm assuming, that go into the values, the Zestimates that you see.

24:54 Yeah, those estimates.

24:55 That's right.

24:56 So, it was really cool.

24:57 And what we were focusing on, or at least what I was brought in to focus on as the geospatial

25:01 lead there, was mapping every single neighborhood in America and Canada to understand like how

25:07 people defined the space around them.

25:09 Because again, for me, in some ways, the geography was more important than the code itself, per se.

25:14 It was.

25:15 Yeah.

25:15 Yeah.

25:15 And it got really cool, but that project was canceled to focus on other big projects.

25:21 So, I got into data pipelines and I did actually a lot of Spark work, some PySpark, but also

25:29 using Scala.

25:30 I did a little bit more Scala.

25:31 So, I cheated on Python there.

25:32 That's for a different podcast.

25:34 But yeah, like it was amazing work.

25:38 And it is still though, in some ways, like web 2.0.

25:41 And I kind of wanted to really be a part of the future.

25:45 I really be a part of whatever this wave is.

25:47 Is this 2.3.0, 4.0, 10.0?

25:50 I don't know anymore.

25:51 More.

25:51 4.0.

25:52 But I think that that's having worked at NEO right before that and seeing what was going

25:57 on there with the self-driving and the computer vision, which is fascinating stuff.

26:01 And just my experience with computer vision actually comes from GIS because classification

26:05 of data, of satellite data is a big part of GIS.

26:08 There's this division between like vector and raster data and the raster data coming out of

26:14 satellites.

26:15 You got to look at the pictures out of the satellites and make some sense of it.

26:18 Is that a river?

26:18 Is that a lake?

26:19 Is that a car?

26:20 It's incredible.

26:21 Just to be able to make these colors, these cells next to each other and make sense of

26:25 it.

26:25 It's incredible.

26:26 It really is.

26:27 And it still blows my mind in some ways.

26:28 So it was a natural move to go into computer vision.

26:33 And what I really realized recently is that it's not that different.

26:36 We have this video data that we're overlaying all kinds of information about what you're seeing

26:42 and you're interacting with it.

26:44 It's a different kind of map is what it is.

26:46 Yeah.

26:46 Yeah.

26:47 You know, I want to just dive in that for a second because I think it's so interesting

26:50 how much these skills that we develop and these things you feel are so specific to some

26:56 particular area, right?

26:57 Like GPS or something like that.

27:01 My experience from going around and doing, I used to do in-person training classes.

27:05 I remember I was one week working at Edwards Air Force Base.

27:08 Then I was working at like a hedge fund in New York the next week.

27:12 And I'm just like, these cannot be more different.

27:15 These groups.

27:16 And what I realized was I was teaching them basically the same thing.

27:19 And they both needed it exactly.

27:21 They both needed a lot, right?

27:24 And it's like, there's this sort of core of what you need to be super good at all these

27:28 ideas.

27:29 And I suspect in the GIS realm, it's kind of similar, like the computer vision, the ML,

27:34 the database, you know, geospatial queries and all those kinds of things.

27:38 Like everyone just needs that.

27:39 And then it's like that little 20% difference that goes on top.

27:42 It seems like it's the whole difference, but it's just a little bit, right?

27:45 Totally.

27:45 Yeah.

27:46 I guess we both chose wisely in that Python became our focus because it incorporates all

27:52 of those things and very nicely, by the way, I think.

27:55 And I really do think that, yeah, it's not that different.

27:59 And it is so cool to be able to just get this basic of programming, the basics of programming

28:05 and whatever you're passionate about.

28:07 And you can just take that across fields and feel really successful and useful.

28:11 Yeah.

28:12 Yeah.

28:12 It's super cool.

28:13 I totally have seen it happen over and over.

28:15 And I just want to highlight it because I know there's a lot of people out there listening

28:18 or knowing that would be really useful, right?

28:20 Like they probably feel like they're struggling to just make it in one area, but really that's

28:24 actually, that's the whole, that's everything.

28:26 Almost all of it, right?

28:27 It's cool.

28:28 Somebody said one time that what's he, like, it's amazing being a developer, but it's even

28:32 cooler in some ways being like, let's say a chemistry person who knows how to program,

28:36 you know, or for me, like environmental or water policy, knows how to program.

28:40 All of a sudden you're so valuable in that office.

28:44 They can't believe they live without you.

28:45 And it's not that different from other types of programming, really.

28:49 It's just data that you're manipulating.

28:51 A lot of ETL, right?

28:52 That's, that's kind of a lot of what we do.

28:54 And that's awesome.

28:55 It's so fun.

28:56 I agree.

28:57 All right.

28:57 So let's actually next spend a little time talking about some of the libraries and whatnot

29:02 that might be worth thinking about that are out there, the types of problems we can solve

29:07 with them.

29:07 So you spoke about Shapely already.

29:09 Maybe give us a quick rundown on Shapely again.

29:11 Yeah.

29:11 There's a team, I suppose, but headed by this one programmer.

29:15 I forget his name right now.

29:17 I think it's Sean.

29:18 But anyway, Shapely and Rosterio are pure Python tools for manipulating geospatial data.

29:25 Shapely is more about once you've read in the data into your code somehow, then you can perform

29:32 distance analysis or you can say, you know, is this car in this neighborhood?

29:37 How far has this car traveled?

29:39 How close was this car to this particular house?

29:42 All those questions that you might need to ask, or you might, you know, calculate demographics

29:47 across space.

29:48 Anything that you need to do with polygons, points, and lines, which is the majority of

29:53 vector data, you're able to do with Shapely.

29:56 And it's very useful in that sense.

29:59 It has a really nice interop between JSON as well.

30:01 Yes.

30:02 Super nice.

30:03 Right?

30:03 Yeah.

30:04 You can store your data in JSON like it just naturally reads and writes that.

30:07 Yeah, exactly.

30:08 There's a format called well-known text as well that it reads.

30:10 So it's very smart in that sense.

30:12 And Rosterio or RosterIO, I always get that confused, is the Roster, Raster, Roster version

30:18 of that.

30:18 I always say Roster, maybe it's Rester.

30:20 But the other one I really like that you have here is GeoAlchemy 2, which is an add-on

30:26 to SQLAlchemy, which is amazing just in itself.

30:30 Like SQLAlchemy is so cool to be able to write code for any particular or general database and

30:36 then be able to have the code work is incredible.

30:38 I really like ORMs.

30:40 I love ORMs too.

30:41 And I think that they just make data so much more accessible and remove some of the error,

30:47 potential error that you might have in working with it.

30:50 Right?

30:50 Like if I'm going to insert something, I don't forget to add this other part of it.

30:53 Right?

30:53 This piece of data.

30:54 Or you might, you know, when you load it up, you might forget to convert some value from

30:59 a string to an end or who knows.

31:01 But right?

31:01 Like you build these classes and it just, you do a few simple things and you've got a really

31:07 legit app working with a database.

31:09 Yeah.

31:09 And so that's SQLAlchemy, obviously, right?

31:11 And Django has its own version, but if you're not doing Django, basically you're probably

31:15 using SQLAlchemy, which has been going strong.

31:18 So GeoAlchemy, what's the story of that?

31:21 It is specific to PostgreSQL with the PostGIS spatial engine add-on, but it allows you to,

31:27 as you're saying, just write a database model that includes geospatial columns.

31:34 So the columns that store these points, lines, and polygons that we're describing.

31:38 And you're able to do with that module, all of these different buffers or intersections

31:44 or any other kind of geospatial analysis that you need to do directly with the data that

31:50 you're storing in your database.

31:51 Nice.

31:52 So if anyone's familiar with SQLAlchemy, it's exactly the same.

31:55 Like you create a declarative base, you create an engine, you do the create tables, like all

32:00 that stuff that you do, you create a session and you add stuff to it.

32:03 So like all those are the same, but you can have interesting stuff.

32:07 Like you could define a class, which is a lake, for example.

32:10 And it's got a primary key, which is an ID.

32:13 It's got a name, which is a string, but then it could have a geometry, which is a polygon,

32:18 which is one of these things coming out of GeoAlchemy, right?

32:21 Yeah.

32:22 Well, GIS, yeah.

32:23 In general.

32:24 Yeah.

32:24 Yeah.

32:25 Yeah.

32:25 Exactly.

32:26 So you just create, like, it's just a different column type out of that library.

32:29 Yeah.

32:30 And yeah, you're out to the races.

32:32 There's always a weird idea within GIS that, like, is spatial special data?

32:36 Are we specialists or are we tech people?

32:39 Like, there's always kind of a weird nebulous feeling there.

32:41 And what it does in some ways is it makes spatial data not special.

32:45 It makes it really easy to deal with.

32:47 It's logical and stored exactly like any other data in a column.

32:51 Associated features are right there in that same row.

32:54 And you can do relationships with it, like just like an ID-based relationships.

32:59 But you can also do spatial relationships.

33:01 You can say, given this neighborhood, how many homes above this age or this price, let's say,

33:07 exist in that neighborhood?

33:09 You know, that kind of query.

33:10 Yeah.

33:10 And you can just treat it like just any other data, but there's just this couple of special

33:15 tweaks that allow it to be really flexible.

33:17 And it's just more database queries, just like the session.query of, like, lake filter.

33:22 And then it's like, excuse me, the geometry contains this point or it intersects this line.

33:28 And presumably those are done with, I guess, some form of an index.

33:33 So that's fast.

33:34 Yes.

33:34 I don't really know, right?

33:35 There's spatial indexing that improves it quite a bit.

33:38 In fact, with the right engine underneath your database, these queries go fast for millions

33:43 of points.

33:43 Postgres is pretty, pretty amazing for being a free digger.

33:46 It's pretty awesome.

33:47 Yeah.

33:48 Yeah.

33:49 Yeah.

33:49 It is super cool.

33:50 You know, we were talking a little bit about it earlier.

33:52 Like Tinder, you know, all these modern apps are geospatial because they've just integrated,

33:58 you know, where you are, where are the object that you're interested in, or like Uber.

34:02 Like, you know, nobody understood what I was saying when I said GIS.

34:04 But when I finally was like, oh, it's like Uber, you know, you see where you are and you see

34:08 the car coming to you, which is...

34:09 And you see the roads where it can go and maybe even optimize a path if it's like a

34:14 shared Uber, whatever that is called.

34:15 All of those are geospatial.

34:17 Sure, they don't share anymore, but they used to.

34:18 I know, right?

34:21 Yeah.

34:21 They used to work together when they had to.

34:23 Yeah.

34:24 So it's built into our modern lives in ways like you were talking about mapping, you know,

34:28 but it's mapping plus information overlay and sorting through that information to find the

34:34 things that are interesting to you across a varied and unique space that you may not be

34:39 familiar with.

34:39 A new city.

34:40 Yeah.

34:40 Yeah.

34:41 Well, when you were first talking about studying your master's degree in geography, just thinking

34:48 back of when I was in middle school or something, I was like, well, what you're going to have

34:51 to do is name all the states in the US.

34:54 You have to name all the countries in Europe.

34:55 Like, okay, well, not super interesting, but I guess I'll like, I'll commit that to memory

35:00 and we'll just, we're going to do this, right?

35:01 And then probably forget most of them.

35:03 And, you know, that's kind of was my like young mind's impression of that.

35:07 Yeah.

35:07 But, you know, if you think of like space overlaid with flowing data and all the questions

35:12 and answers that you have, all of a sudden it becomes this really interesting programming

35:17 problem and a really important for people's lives.

35:19 Well, let me have a quick diversion here.

35:22 So back in the thirties, especially there was a lot of geographers hired to like make flood

35:26 maps or other kinds of maps.

35:28 They were trying to figure out like, where are disparities across space and how can we help

35:31 people?

35:31 And it was a top level science.

35:34 Geography had departments all across like Harvard, Yale, all of those schools.

35:38 But then to be honest, there was like a supposed like homosexual scandal at one of these schools

35:44 where like, you know, a geography professor was living with one of his grad students and

35:48 president who had skepticism around the science itself kind of decided just to cut it out.

35:54 And because like he gave a different reason for it, but that was the rumor behind it all.

35:59 Oh my gosh.

35:59 Yeah.

36:00 So it was Harvard or Yale.

36:01 They cut it out.

36:02 And then all the other top IVs followed.

36:04 But in most other countries, geography is a top level study because you're really understanding

36:09 like, why are these people suffering from pollution more than these people next to them?

36:13 What are the prevailing winds?

36:15 What are the reasons that they live there?

36:16 What are the historical, you know, why were black communities affected by freeways in the

36:21 seventies more than other communities?

36:23 You know, it was partially their political power, partially where they were living because the

36:27 elevation was flatter and it was more prone to floods.

36:30 There's just all these geographic questions that are kind of amazing to study and you can

36:34 get hyper-specific with it, but didn't appeal apparently to these top level schools until

36:39 around 2005 when Harvard started its spatial library.

36:43 And that was like a GIS focused library.

36:46 And they brought back geography or at least some component of it that was tangible to them.

36:50 Oh, wow.

36:51 Yeah.

36:51 I had no idea about that history.

36:52 Nobody does.

36:53 It is sort of a unique component to this like science.

36:57 That's everywhere and nowhere.

36:58 No pun intended, really.

37:00 Yeah, absolutely.

37:01 So we talked about geo-alchemy.

37:03 There's a geo-alchemy there.

37:04 It's called geo-alchemy 2.

37:06 What happened to 1?

37:07 Or no suffix.

37:08 Do you know?

37:09 Go straight to 2.

37:10 You know, whoever started 1 abandoned it and somebody else took it over.

37:15 Yeah.

37:15 Yeah.

37:15 But they didn't want to edge it out or say, all right, we'll call it 2.

37:17 Yeah.

37:18 If we're in Django, we have geo-django.

37:20 That sounds better.

37:22 Geo-django.

37:22 Sounds fun.

37:23 But maybe it's got to live within the Django models and stuff like that.

37:27 Yeah.

37:27 Obviously, if you're using Django, you probably would consider that.

37:30 It's actually right built in.

37:32 You just have to import one more thing in your admin.py.

37:34 I believe that's what it's called.

37:35 Or I haven't used geo-django in a few years.

37:38 But it's like, you know, right from the get-go, when Adrian and his buddy were designing Django,

37:43 they were doing the EveryBlock project that they ended up selling to CBS, which was kind

37:48 of like a citizen app in 2007 where they were saying, like, here's what's happening on every

37:53 block in America.

37:54 And so, geography was built in early into Django.

37:57 Oh, interesting.

37:58 I had no idea about that history.

38:00 Yeah.

38:00 I mean, Django comes out of newsrooms, right?

38:03 Yeah.

38:03 It came from the lore and internal world or something like that.

38:06 So, it makes total sense that it would have that, some of those ideas in there.

38:10 Yeah.

38:11 As soon as he left, Adrian, I forget his last name right now.

38:14 Anyway, he started EveryBlock and I think he did well selling that.

38:17 It was like a huge part, as you said, and it's very much related to reporting.

38:21 So, I was like, yeah.

38:22 I'm more into Flask these days, which it's just kind of simple and you can just add what

38:27 you need when you need it.

38:28 No disrespect to Django.

38:29 Django's fantastic.

38:30 Yeah.

38:30 So, if you're in Flask, GeoAlchemy too, obviously, right?

38:34 Yep.

38:34 But if you're in Django, probably you just use the features that are built straight into it, right?

38:37 Tons of tutorials about it all around.

38:39 Yeah.

38:40 It was well supported.

38:41 Yeah.

38:41 So, you have some that are on ArcGIS, which is the Esri commercial package, which they actually

38:48 do a ton with Python as well over Esri, which, so if you're doing Python, you might, it might

38:53 still be a great place to be, but it's also, you know, something you pay for.

38:55 So, you might alternatively consider some of the piecing together things from some of the

39:00 open source tools, right?

39:01 But yeah.

39:01 So, tell us about your books.

39:02 Sure.

39:02 Yeah.

39:03 I got the opportunity, having volunteered to review some books in like 2012, an early

39:09 open source Python GIS book.

39:11 It was great.

39:12 And I was on PAC Publishers list and they kept emailing me like, can you write a book about

39:16 network security and Python?

39:18 And I was just thinking, no, I can't.

39:20 I don't know anything about that at all.

39:22 How about cutting edge cryptography?

39:23 Have you done that?

39:24 Yeah.

39:24 Exactly.

39:24 I also know.

39:25 Sounds like you've got the same emails, huh?

39:27 Yep.

39:28 So, I finally wrote back to them.

39:30 I was like, look, I am a GIS professional and I can write about that.

39:34 If you have any interest, let me know.

39:36 Otherwise, stop emailing me.

39:37 And they said, yeah, actually we do.

39:39 So, they recruited me to write a book on ArcPy, which was at that point about five years old,

39:45 but it was just getting more and more prominence.

39:47 And I was obviously an early proponent.

39:49 And I wrote that first book, ArcPy and ArcGIS, Geospatial Analysis with Python, which we did

39:56 a second version of me and my coworker, Dara.

39:58 And that one focused more on the newer ArcGIS Pro, which uses the Python library for that as

40:05 Python 3.

40:05 The problem with ArcPy is it's Python 2 based.

40:08 So, it'll be supported for a while in terms of Esri, but the greater Python world is rapidly

40:14 leaving it behind.

40:15 Yeah.

40:15 There are some interesting industries that kind of get stuck.

40:18 They so embrace Python, but they embrace it in a way where they package it into their tooling.

40:24 And I'm thinking of the movie and entertainment workflow industry.

40:29 There's all these tools like Maya and whatnot that have Python built in.

40:32 And a lot of them embedded the Python 2 runtime.

40:36 And they're just, until they as a group decide to change, they're like, that's how it is,

40:41 you know?

40:41 Yeah, exactly.

40:42 You know, Esri keeps trying to retire its ArcMap product in favor of this new ArcGIS Pro.

40:48 But it's not going to happen because they have a huge sort of lazy, let's say, no offense,

40:53 workforce that doesn't want to learn a whole new software.

40:56 And I totally get it.

40:57 Yeah, maybe they have stuff that works and they don't consider building those things

41:02 or maintaining their job.

41:03 They just need that to work for their job, right?

41:06 And that's good for them, but it's a tough place to be.

41:09 They wrote this software called Avenue, which was their original programming language or one

41:14 of them in the early aughts.

41:15 And people are still using some of those scripts, I'm sure, in places.

41:19 So, you know, things stick if they work, just like you said.

41:22 And it makes sense.

41:23 Yeah, so you took another take on this.

41:25 Yeah, and it was fun.

41:26 I actually recruited some help because writing books is a lot on Twitter and found a couple

41:31 guys that I follow on Twitter.

41:33 And we wrote this book, Mastering Geospatial Analysis with Python 3, which is like a 16-chapter

41:39 review of available modules.

41:42 Does a pretty good job of going from like very specific geospatial stuff all the way up to big

41:47 data.

41:48 And there's a couple chapters in there on interactive web mapping that I wrote around

41:52 Flask and GeoAlchemy as well as GeoDjango.

41:55 I thought it was great.

41:56 We even touched on, do you know what MapD, they became OmniSci.

42:00 It's sort of a...

42:01 Oh, I don't know.

42:02 It's like a GPU database tool that does some pretty amazing visualizations.

42:08 And they have a Python module, PyMapD.

42:11 They may have changed the name.

42:12 Yes, things like that.

42:13 Like all these incredibly cool modules that just kind of blew me away.

42:17 We just touched on it really because there's so much to touch on.

42:20 But I think it's a great book.

42:22 I really liked writing it and it's so wide.

42:24 Well, it sounds like it really does a good coverage of all these things if you're into

42:28 Python plus geospatial.

42:29 Yeah.

42:30 Well, yeah.

42:31 It's not like it's selling like hotcakes or anything.

42:34 You know, these...

42:36 Well, not before your appearance on the podcast.

42:38 Yeah, there you go.

42:38 Yeah.

42:39 Yeah.

42:39 I'll be looking for those checks rolling in, right?

42:42 That's right.

42:43 Yeah.

42:43 I would say it's only 30% like the App Store.

42:45 Don't worry, I'll be fine.

42:46 No, just kidding.

42:47 But speaking of podcasts, you spent close to a year doing a podcast on GIS topics, right?

42:55 I did.

42:56 And that was a joy.

42:57 I mean, it's fun being back here and remembering how much fun this is.

43:00 My co-host, Todd Barr, who is the spatial punk.

43:04 He's sort of Esri's aside and the thorn of Esri is sort of his like thing.

43:09 And, you know, he's just criticizing like the lack of support for big data and just really

43:15 innovative or any kind of innovation the way he sees it.

43:19 I think like there's some great tools coming out of Esri like ArcPy and ArcServer is very

43:24 cool.

43:24 But he felt like within the realm, they had too much dominance and not enough like push

43:29 towards really cool, new and fast pipeline supports, especially for big data.

43:35 So we had a lot of discussions with all kinds of different users, though, around like different

43:40 focuses, cartography to big data to archaeology.

43:44 We had a journalist up in my hometown who does like a, it's a Django based website that gets

43:50 like 3 million hits a month.

43:51 And they use a lot of GeoDjango to like locate where all the different, say, arrests or accidents

43:57 happen.

43:58 They just pull in records from the courthouse and automatically add location to it.

44:03 It's one of those things like you were saying about just adding in just a little bit of Geo

44:07 that makes your field, whatever it is, way better.

44:10 Yeah.

44:11 I recently did an episode on Python and AI ML in journalism.

44:16 And there was a lot of geospatial stuff there as well about like automatically understanding,

44:20 you know, like earthquakes in real time or crime in real time and those types of things as

44:27 well.

44:27 So yeah, I think it spans a lot.

44:29 Have you heard of a hood line down here?

44:31 Hood line?

44:31 No.

44:32 They've gone national.

44:33 In fact, I think they were purchased by Nextdoor, but it is a journal.

44:37 It's like a local neighborhood journalism site focused on all kinds of different cities,

44:41 but it started here actually in the neighborhood.

44:43 I live in San Francisco in the lower Haight.

44:45 And it was all about trying to automate a lot of the like exposition within a story.

44:51 If like a restaurant opened or something, they could tell you about all the other restaurants

44:54 that opened within a certain radius, that kind of thing.

44:56 So machine learning and ghostwriting a lot of their stories was a big focus.

45:00 I thought it was amazing.

45:01 Oh, yeah.

45:01 How interesting.

45:02 That makes perfect sense for Nextdoor, of course.

45:04 They're trying to like hyper local stuff.

45:06 Maybe just give us a quick couple of your favorite episodes for your podcast.

45:09 People, I'll link to the show and people can check it out if they're interested.

45:13 The cartography one with Sarah Bell was really fun because we talked to her about just kind

45:18 of, you know, cartography and her GIS career, but also like what it's like being a woman in

45:22 the field and how she's loved it and hated it at times.

45:27 That one really resonated.

45:28 I thought the journalism one was fascinating because, you know, we're talking about all kinds

45:32 of different crazy stories that they've covered.

45:34 For instance, they did a, you know, where I'm from, Humboldt County, there's a lot of

45:37 marijuana up there.

45:38 And so they did like a comparison with satellite imagery saying like, do you think this satellite

45:44 has marijuana grown in it?

45:45 And it pissed off all the locals, but it made for an amazing like application through their

45:50 website.

45:53 It's kind of a crazy mix of GIS and crime and reporting, which is just such a fascinating

46:00 way to approach the world because that's really how things work.

46:03 You know, things are located somewhere.

46:05 Yeah.

46:05 And a lot of those things are affected by the location that you're in, right?

46:09 Quality of schools, the attitude or predispositions the police might have and perceiving the people

46:15 in that neighborhood may vary a lot, right?

46:18 Things like that.

46:19 Oh, yeah.

46:19 You know, you can tell these stories with data, right?

46:22 Yeah.

46:22 Well, I was, so the CEO of Hoodline, when she brought me on as a consultant, I was encouraging

46:27 her like, you have to know every gang territory in LA, you know, like that's the kind of thing

46:33 that would really make for an amazing story, especially for automating it.

46:37 So we never went that far with it, but I think there's still room to do that.

46:40 Yeah.

46:40 I guess there probably would, right?

46:42 Yeah.

46:43 So the Mappiest Hour was really fun.

46:45 And Todd was a great co-host.

46:47 We're still talking about doing some more maybe next year, but it was a very big year for

46:51 us both.

46:52 Yeah.

46:52 So you had, you had season one and then maybe you could do season two.

46:55 There you go.

46:56 Yeah.

46:56 Well, with this kind of encouragement, I'm loving this.

46:59 So yeah, maybe I'll just ride this wave.

47:01 Call them out.

47:02 It's always fun.

47:04 Yeah.

47:05 You're just like sort of a bit of a sidebar with fellow podcaster.

47:08 Like it's really interesting that the people that you get to meet, right?

47:12 If there's so many folks that I've spoken to that generally, at least before I got into

47:17 the podcast, you know, five years ago would have not really bothered to give me the time

47:21 of day, or at least they wouldn't have been excited about it.

47:23 Right.

47:24 And now I, almost everyone I reach out to is excited to be part of the show, to share

47:28 their story, to talk, and you just get to meet so many interesting people.

47:30 It's just such an honor to sort of be part of that.

47:34 Right.

47:34 It's cool.

47:34 Oh my God.

47:35 It really is.

47:36 I'm loving this.

47:37 And you must have just so much fun.

47:38 You're doing this full-time now or?

47:40 Full-time.

47:41 Yeah.

47:41 Two shows a week.

47:42 Yeah.

47:43 It's great.

47:43 Oh, that's great.

47:44 It's just such a cool dive into who we as developers are, which is much more, much less

47:49 monolithic than it sounds like initially.

47:51 And there's just so many different ways and things you can do with code.

47:55 Yeah.

47:55 And you touched so much on it when you talked about that person who, not necessarily a CS grad,

48:00 but some other expertise, but now has the magic programming power that most people don't.

48:05 And there's just so many interesting stories and use cases and libraries and applications

48:10 coming out of that side of the world that it's bottomless.

48:13 It's cool.

48:14 Just got to grasp what a for loop is and you're well on your way.

48:17 Exactly.

48:18 pip install and you're going to be good.

48:19 All right.

48:21 Let's see.

48:21 One more thing that we threw out to talk about was WebGIS for Flask or Django APIs.

48:26 Tell us maybe about that real quick.

48:27 Well, you can just do some amazing APIs with Flask or Django in general, but with Geo, especially

48:33 with if you're building like a phone, an iPhone app or an Android app, you know, you can just

48:37 send your location and have all kinds of context sent back to the application based on these

48:43 APIs.

48:43 So they're quick to put up.

48:45 They're easy to maintain and you can integrate spatial right into it.

48:49 It really isn't that much work.

48:50 There's a little bit deeper understanding of like the type of spatial function you may

48:54 need for a specific moment.

48:56 But none of that is going to take a master's degree.

48:58 In fact, I think just like reading some online tutorials or some stack.

49:02 There's a Geo stack overflow even, I think.

49:06 Oh, cool.

49:06 Yeah.

49:06 The GIS dot stack overflow.

49:08 Something like that is very, very useful.

49:10 A stack exchange.

49:11 Yeah.

49:11 Probably.

49:12 There you go.

49:12 That's it.

49:13 Yeah.

49:13 Yeah.

49:13 Or you can buy my books.

49:14 Yeah.

49:16 Now, the amount of data that you have to exchange is actually pretty small for these applications.

49:21 Like where am I or what path have I taken?

49:23 Yeah.

49:24 And so on.

49:25 But it's easy to build APIs random.

49:27 I would suspect like on the back end, have it something like Geo SQL, Geo Alchemy 2.

49:32 Just indexes.

49:33 Make sure you have indexes.

49:34 The coolest thing I ended up doing at Zillow was building what we called the Surveyor.

49:39 It was just a working title, but it was a just literally a web map built in Flask, PostGIS,

49:44 to be able to actually see a lot of the data that we were building and creating and comparing.

49:48 Because internally, we didn't have like a mapping tool that could really speak to all of the geospatial data that we had.

49:56 It was such a surprise to me.

49:57 And I ended up winning the Hack Week there earlier this year before I left.

50:01 And that was just like so fun because I presented it at the end of Hack Week.

50:06 And they instantly were like, yes, why don't we have this already?

50:09 That's awesome.

50:10 That's super cool.

50:11 Congratulations.

50:11 One more thing on the library side, I guess, is probably worth throwing out.

50:15 So we've talked a lot about server side things.

50:19 And you talked about your cool experiences with JavaScript in the front end.

50:22 If I'm going to do mapping data, especially interactive maps, there's got to be some fancy library that goes on the front end that makes this happen.

50:30 So what would you recommend to check out?

50:33 Sure.

50:33 Yeah, there's less fancier ones, I would say, that Leaflet is considered, which is a JavaScript library.

50:39 It's considered a medium level knowledge that you could use.

50:44 And then MapGL, Mapbox GL, I'm sorry, is a little bit higher level, but it has really fine controls over what you can do.

50:51 And you can have all kinds of events.

50:54 There are some pure Python front end tools like Dash and a few others that do have mapping integrated as well as graphs.

51:02 And that can be really useful.

51:04 You don't have to handle much of the HTML if you don't want to.

51:07 But I find it, if you're going to get into interactive web mapping, really useful to know both Python and JavaScript to make them work together.

51:14 Yeah.

51:15 A lot of the interactive stuff happens on, it has to happen on the client side, right?

51:19 Yeah.

51:19 So that means some kind of JavaScript.

51:22 Get used to curly braces, right?

51:24 Yeah, exactly.

51:25 Don't forget the semicolons.

51:26 Actually, in JavaScript, you can forget them, which is kind of good, I guess.

51:29 It took me a long time to get into JavaScript because I was so used to the clean nature of Python.

51:34 Like, and no joke, that attracted me to Python.

51:37 It was so important to be able to read the code.

51:39 Yeah, and I feel like JavaScript used to be closer to that world.

51:42 It used to be pretty simple.

51:43 Now it's like, you know, all sorts of dependencies require this.

51:46 And then like, you know, you pack up these things and it's just like, oh my gosh.

51:51 Or, you know, you pre-compile or transpile your TypeScript over to this and then you pack it up and you minify.

51:56 It's like, whoa, whoa, whoa, whoa.

51:57 What happened to just including something in the page?

52:00 I mean, when I do demos or proof of concept, it's always pretty vanilla with like one mapping library or something.

52:08 There's some other cool ones too that Uber is putting out a ton of really cool stuff like deck.gl.

52:13 And there's another one I forget.

52:15 But if you want to get into super fancy data visualization, I recommend looking into Uber's set of JavaScript tools.

52:22 It's pretty amazing stuff.

52:23 But yeah, I prefer a much more vanilla implementation of myself just for my brain to manage it and to understand it.

52:32 Yeah, super cool.

52:33 All right, let me close out our conversation with one sort of more general question here.

52:38 So people out there listening, a lot of them have Python skills, obviously, or building up their Python skills.

52:43 How much do you need to know to be useful and powerful?

52:53 Like, do you need to go get a degree?

52:54 How much work is it to get into this?

52:57 If you want to really understand the theories behind geography, yeah, I think grad school can be really useful or just an undergrad degree because it really helps you understand like just why it's cold in the Arctic and warm at the equator.

53:10 Like just at that basic level.

53:12 It is amazing.

53:13 And the relationship between the two and the relationship between that and human culture.

53:17 So if you want to really understand humans, yes, go into geography.

53:20 But if you want to make a geospatial data pipeline, I think what you really have to know is just like what is the data you're getting in and what is the data you want to get out and what are your resources in between.

53:30 You don't have to know much more than that.

53:32 There's all kinds of tutorials.

53:33 There's books.

53:34 There's a weekend of exploration ahead of you.

53:37 It's not that hard, but it is really powerful.

53:40 Well, it does sound like a really fun area to get into.

53:43 And a lot of times these visual aspects are pretty cool for people who are not sure that they're necessarily programmers.

53:49 But then if you build something that you can see and touch and share, like all of a sudden it makes a big difference, I find.

53:54 Completely agree.

53:55 It's one of the coolest things you do.

53:56 And I still get that thrill I got, you know, from showing my grandmother the little lat long that I was able to pull from a shape file.

54:03 Super cool.

54:06 All right.

54:07 Now, before I let you out of here, you got to answer the two questions I always put at the end of the show.

54:11 If you're going to write some Python code, what editor do you use?

54:13 Lately, it is PyCharm.

54:15 I really like it.

54:16 Before that, it was sublime because it's just simple and you don't have to think too much about it.

54:20 But PyCharm is fantastic.

54:21 Yeah.

54:21 It's my favorite as well.

54:22 I love it.

54:23 And notable PyPI package.

54:25 I mean, we definitely threw a bunch out there.

54:26 I think PyShape is the lowest level one because unfortunately still this really ancient data format is the major data format in

54:36 GIS.

54:37 So PySHP, that tool will allow you to read and write it just in pure Python.

54:42 Awesome.

54:42 Cool.

54:43 All right.

54:43 So final call to action, people are interested in GIS.

54:46 What do you say to them?

54:47 And Python.

54:47 It's an amazing field.

54:48 How do I put those together?

54:49 Yeah.

54:50 This is the future.

54:50 Or maybe the future is here.

54:52 But either way, there's so much that can be done in this space.

54:54 We're just touching on it.

54:56 People are just hearing about it, let alone realizing that there's so much more to do with it.

55:01 So, yes, come join me.

55:02 Yeah.

55:02 It definitely feels like maybe the future is here.

55:05 It feels like part of the future.

55:06 Like I remember so many of these things, the GPS stuff, the Zillow stuff, all those different just literally blew my mind when I saw them.

55:13 And I'm reminded of the William Gibson quote.

55:17 Like the future is here.

55:18 It's just not evenly distributed.

55:20 Exactly.

55:20 Yeah.

55:21 Yeah.

55:21 That is so true.

55:22 The future is generally in your hands these days, but not everybody has the same phone.

55:26 That's true.

55:26 That's true.

55:27 All right.

55:27 Well, Silas, thank you for being on the show.

55:29 It was great to chat with you.

55:29 It was so fun, Michael.

55:30 Thank you so much.

55:31 Yeah.

55:31 Yeah.

55:31 Thanks for sharing this.

55:32 See ya.

55:32 This has been another episode of Talk Python to Me.

55:36 Our guest on this episode was Silas Toms, and it's been brought to you by us over at Talk Python Training and Linode.

55:42 Simplify your infrastructure and cut your cloud bills in half with Linode's Linux virtual machines.

55:47 Develop, deploy, and scale your modern applications faster and easier.

55:50 Visit talkpython.fm/Linode and click the create free account button to get started.

55:55 Want to level up your Python?

55:57 If you're just getting started, try my Python Jumpstart by Building 10 Apps course.

56:02 Or if you're looking for something more advanced, check out our new async course that digs into all the different types of async programming you can do in Python.

56:10 And of course, if you're interested in more than one of these, be sure to check out our Everything Bundle.

56:15 It's like a subscription that never expires.

56:16 Be sure to subscribe to the show.

56:19 Open your favorite podcatcher and search for Python.

56:21 We should be right at the top.

56:22 You can also find the iTunes feed at /itunes, the Google Play feed at /play,

56:27 and the direct RSS feed at /rss on talkpython.fm.

56:32 This is your host, Michael Kennedy.

56:33 Thanks so much for listening.

56:35 I really appreciate it.

56:36 Now get out there and write some Python code.

56:38 Thank you.

56:38 Thank you.

56:39 Thank you.

56:39 Thank you.

56:40 Thank you.

56:40 Thank you.

56:41 Thank you.

56:41 Thank you.

56:42 Thank you.

56:42 Thank you.

56:43 Thank you.

56:44 Thank you.

56:44 Thank you.

56:44 Thank you.

56:44 Thank you.

56:44 Thank you.

56:45 Thank you.

56:46 Thank you.

56:46 Thank you.

56:46 Thank you.

56:47 Thank you.

56:48 Thank you.

56:48 Thank you.

56:48 Thank you.

56:48 Thank you.

56:49 Thank you.

56:50 Thank you.

56:50 Thank you.

56:51 Thank you.

56:52 Thank you.

56:52 Thank you.

56:53 Thank you.

56:54 Thank you.

56:54 Thank you.

56:55 you you Thank you.

Back to show page
Talk Python's Mastodon Michael Kennedy's Mastodon